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