Distance
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.
Input
The input file contains 1 integer value.
Output
Print the necessary time followed by the message “minutos” that means minutes in Portuguese.
Input Sample | Output Sample |
30 | 60 minutos |
110 | 220 minutos |
7 | 14 minutos |
Solution 1
#include<stdio.h>
int main()
{ int d;
scanf("%d",&d);
printf("%d minutos\n",d*2);
return 0;
}
Solution 2
#include <stdio.h>
int main() {
int n,s;
scanf("%d", &n);
s= 150 / 60 * n;
printf("%d minutos\n",s);
return 0;
}
- URI Online Judge | 1038 Solution |Snack
- URI Online Judge | 1036 Solution | Bhaskara’s Formula
- URI Online Judge Solution| 1035 Selection Test 1
- URI Online Judge Solution| 1021 Banknotes and Coins
- URI Online Judge Solution| 1020 Age in Days
- URI Online Judge Solution| 1019 Time Conversion
- URI Online Judge Solution| 1018 Banknotes
- URI Online Judge Solution| 1017 Fuel Spent
- URI Online Judge Solution| 1016 Distance
- URI Online Judge Solution| 1015 Distance Between Two Points
- URI Online Judge Solution| 1014 Consumption
- URI Online Judge Solution| 1013 The Greatest
- URI Online Judge Solution| 1012 Area
- URI Online Judge Solution| 1011 Sphere
- URI Online Judge Solution| 1010 Simple Calculate
- URI Online Judge Solution| 1009 Salary with Bonus