Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class techModuleSnowBalls {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int n = Integer.parseInt(scanner.nextLine());
- double maxValue = Double.MIN_VALUE;
- int maxSnow = 0;
- int maxTime = 0;
- int maxQuality = 0;
- for (int i = 0; i < n; i++) {
- int snow = Integer.parseInt(scanner.nextLine());
- int time = Integer.parseInt(scanner.nextLine());
- int quality = Integer.parseInt(scanner.nextLine());
- double value = Math.pow(snow / time, quality);
- if (maxValue < value) {
- maxValue = value;
- maxSnow = snow;
- maxTime = time;
- maxQuality = quality;
- }
- }
- System.out.println(String.format("%d : %d = %.0f (%d)",maxSnow,maxTime,maxValue,maxQuality));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement