Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package DataTypes;
- import java.util.Scanner;
- public class TheaThePhotographer {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int picturesTaken = Integer.parseInt(scanner.nextLine());//1 000 000
- int filterTimePerPicture = Integer.parseInt(scanner.nextLine());//100 000
- int filterFactor = Integer.parseInt(scanner.nextLine());// в проценти
- int uploadingTimePerPicture = Integer.parseInt(scanner.nextLine());//100 000
- // d:HH:mm:ss
- double goodPictures = Math.ceil(picturesTaken * filterFactor / 100);
- long filterTime = (long)picturesTaken * filterTimePerPicture;
- double uploadingTime = goodPictures * uploadingTimePerPicture;
- double totalTime = filterTime + uploadingTime;
- long d = (long) totalTime / 86400;
- long hh = ((long) totalTime - d * 86400) / 3600;
- long mm = ((long) totalTime - d * 86400 - hh * 3600) / 60;
- long ss = (long) totalTime - d * 86400 - hh * 3600 - mm * 60;
- System.out.printf("%01d:%02d:%02d:%02d", d, hh, mm, ss);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment