Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner in = new Scanner(System.in);
- int N = Integer.parseInt(in.nextLine());
- double highestSnowballValue = -1;
- double highestSnowballSnow = 0;
- double highestSnowballTime = 0;
- double highestSnowballQuality = 0;
- for (int i = 0; i < N; i++) {
- double snowballSnow = Integer.parseInt(in.nextLine());
- double snowballTime = Integer.parseInt(in.nextLine());
- double snowballQuality = Integer.parseInt(in.nextLine());
- double snowballValue = Math.pow((snowballSnow / snowballTime), snowballQuality);
- if (snowballValue > highestSnowballValue) {
- highestSnowballValue = snowballValue;
- highestSnowballSnow = snowballSnow;
- highestSnowballTime = snowballTime;
- highestSnowballQuality = snowballQuality;
- }
- }
- if ((highestSnowballValue - Math.floor(highestSnowballValue)) > 0) {
- System.out.printf("%d : %d = %.2f (%d)%n",
- (int) highestSnowballSnow,
- (int) highestSnowballTime,
- highestSnowballValue,
- (int) highestSnowballQuality);
- } else {
- System.out.printf("%d : %d = %d (%d)%n",
- (int) highestSnowballSnow,
- (int) highestSnowballTime,
- (int) highestSnowballValue,
- (int) highestSnowballQuality);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement