fork download
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6. scanner.nextDouble();
  7. scanner.nextDouble();
  8. double length = 0;
  9. while(scanner.hasNextDouble()) {
  10. double startX = scanner.nextDouble();
  11. double startY = scanner.nextDouble();
  12. double finishX = scanner.nextDouble();
  13. double finishY = scanner.nextDouble();
  14. length += Math.sqrt((finishX - startX) * (finishX - startX) + (finishY - startY) * (finishY - startY));
  15. }
  16. long minutes = Math.round(3 * length / 500);
  17. System.out.print(minutes / 60 + ":" + minutes % 60);
  18. }
  19. }
  20.  
Success #stdin #stdout 0.07s 2184192KB
stdin
0 0
0 0 10000 10000
5000 -10000 5000 10000
5000 10000 10000 10000
stdout
3:55