fork download
  1. #include <iostream>
  2. #include <cmath>
  3. #include <cstdio>
  4. using namespace std;
  5.  
  6. int main() {
  7. // your code goes here
  8. double speed = 60.0;
  9. double distance;
  10. int a, b, c;
  11. scanf("%lf %d %d %d", &distance, &a, &b, &c);
  12.  
  13. cout << distance << " " << a << " " << b << " " << c << endl;
  14. cout << (fmod((distance*3600)/speed, (a + b + c))) << endl;
  15. return 0;
  16. }
Success #stdin #stdout 0s 3144KB
stdin
15.1 1 1 1
stdout
15.1 1 1 1
0