Monday, July 04, 2016

URI Online Judge Solution : 1016 Distance (Beginner Problem)

Posted by LIfe2Coding on Monday, July 04, 2016 in | No comments

URI Online Judge | 1016


Adapted by Neilor Tonin, URI  Brazil
Timelimit: 1
Two cars (X and Y) leave in the same direction. The car X leaves with a constant speed of 60 km/h and the car Y leaves with a constant speed of 90 km / h.
In one hour (60 minutes) the car Y can get a distance of 30 kilometers from the X car, in other words, it can get away one kilometer for each 2 minutes.
Read the distance (in km) and calculate how long it takes (in minutes) for the car Y to take this distance in relation to the other car.


The input file contains 1 integer value.


Print the necessary time followed by the message " minutos" that means minutes in Portuguese.
Input SampleOutput Sample
3060 minutos
110220 minutos
714 minutos


#include <stdio.h>
#include <math.h>

int main()
 int A;
 scanf("%d", &A);
 printf("%d minutos\n", 2 * A);
 return 0;


Post a Comment