fork download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main() {
  6. int temp;
  7. cin >> temp >> temp;
  8. double lengthOfRoads = 0;
  9. double firstX, firstY, secondX, secondY;
  10. while (cin >> firstX >> firstY >> secondX >> secondY)
  11. {
  12. lengthOfRoads += sqrt((secondX - firstX)*(secondX - firstX)+(secondY - firstY)*(secondY - firstY));
  13. }
  14. int minutes = round(3 * lengthOfRoads / 500);
  15. cout<< minutes / 60 << ":" << minutes % 60;
  16. return 0;
  17. }
Success #stdin #stdout 0s 4296KB
stdin
0 0 
0 0 -1000 2000
0 0 1000 2000
stdout
0:27