[URI Online Judge] – 1016 – Distance

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. Read the distance (in km) and calculate how long it takes (in minutes) for the car Y to reach this distance in relation to the other car.

Input

The input file contain 1 integer number.

Output

Print the necessary time followed by the message ” minutos” that means minutes in portuguese.

Sample Input Sample Output
30 60 minutos
110 220 minutos
7 14 minutos

Solution:

#include <cstdio>
#include <cmath>

int main(){
 int n;
 scanf("%d", &n);
 printf("%d minutos\n", 150 / 60 * n);
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s