Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int snowballs = Integer.parseInt(scanner.nextLine()),
- snowballSnow, snowballTime, snowballQuality;
- double value, highestValue = 0;
- String output = "";
- for (int i = 0; i < snowballs; i++) {
- snowballSnow = Integer.parseInt(scanner.nextLine());
- snowballTime = Integer.parseInt(scanner.nextLine());
- snowballQuality = Integer.parseInt(scanner.nextLine());
- value = Math.pow((double)(snowballSnow) / (double)(snowballTime), (double)(snowballQuality));
- if (value > highestValue) {
- highestValue = value;
- output = String.format("%d : %d = %.0f (%d)", snowballSnow, snowballTime, value, snowballQuality);
- }
- }
- System.out.println(output);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement