Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.util.Scanner;
- public class Jedi {
- public static void main(String[] args) {
- Scanner scanner=new Scanner(System.in);
- byte n= Byte.parseByte(scanner.nextLine());
- int highestSnowballValue=Integer.MIN_VALUE;
- int snowballQuality = 0;
- int snow=0;
- int time=0;
- for (int i = 0; i <n ; i++) {
- short snowballSnow= Short.parseShort(scanner.nextLine());
- short snowballTime= Short.parseShort(scanner.nextLine());
- byte snowballlQuality= Byte.parseByte(scanner.nextLine());
- int snowballValue=(int) Math.pow(snowballSnow/snowballTime, snowballlQuality);
- if (snowballValue>=highestSnowballValue){
- highestSnowballValue=snowballValue;
- snowballQuality=snowballlQuality;
- snow=snowballSnow;
- time=snowballTime;
- }
- }
- System.out.printf("%d : %d = %d (%d)", snow, time, highestSnowballValue, snowballQuality);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement