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 scan = new Scanner(System.in);
- int n = Integer.parseInt(scan.nextLine());
- long snowballValue = 0;
- int snow = 0;
- int time = 0;
- int quality = 0;
- for (int i = 0; i < n; i++) {
- int snowballSnow = Integer.parseInt(scan.nextLine());
- int snowballTime = Integer.parseInt(scan.nextLine());
- int snowballQuality = Integer.parseInt(scan.nextLine());
- long divide = (long) Math.pow(snowballSnow / snowballTime, snowballQuality);
- if (divide >= snowballValue) {
- snowballValue = divide;
- snow = snowballSnow;
- time = snowballTime;
- quality = snowballQuality;
- }
- }
- System.out.printf("%d : %d = %d (%d)%n", snow, time, snowballValue, quality);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment