Wednesday, December 2, 2015

Uri problem 1016 solve

Problem :

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, that means, it can get 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 contain 1 integer number.

Output

Print the necessary time followed by the message " minutos" that means minutes in portuguese.
Sample InputSample Output
3060 minutos
110220 minutos
714 minutos

Solution:

#include <iostream>
#include <stdio.h>
 
int main(){
     
    int a;
     
    std::cin >> a;
     
    printf("%d minutos\n", (a*60)/30);
    return 0;
}

No comments:

Post a Comment