PROBLEM LINK: CodeChef: Practical coding for everyone
Author: Setter’s name
Tester: Tester’s name
Editorialist: Editorialist’s name
DIFFICULTY : BEGINNER
PREREQUISITES:
Nill
PROBLEM:
Mukesh is travelling to a certain place which is m kilometers away from his current position.
It is seen that he is travelling at a constant speed n. Find the time taken by Mukesh to reach his destination in seconds?
QUICK EXPLANATION:
Speed = Distance / Speed
EXPLANATION:
Speed = Distance/Time Or Time =Distance/Speed.
output should be in seconds (2 decimal places)
Since the input is in kmph and km => Time from formula is in hours
Final answer = (Distance/Speed)6060
SOLUTIONS:
Setter's Solution
using namespace std;
int main() {
float dist ,speed,tim;
cin>>dist>>speed ;
tim=dist/speed;
tim=tim*3600;
printf(“%.2f”,tim);
return 0;
}
Tester's Solution
m=int(input())
n=int(input())
a=(m/n)6060
print(format(a,“.2f”))
second line is speed (in Km/hr)
Editorialist's Solution
m=int(input())
n=int(input())
a=(m/n)6060
print(format(a,“.2f”))
second line is speed (in Km/hr)