UVA – 10300 – Ecological Premium

  • ID : UVA – 10300 – Ecological Premium
  • Submissions : Java – Accepted
  • Difficulty : Shame to solve.
  • Type : Simple Math.
  • Time for Submission : 20 minutes
  • Solution Description :
    • simple & straight forward sum all the sizes* environment and ignore the number.
  • Problems :
    • No problems, it went smoothly.
  • Code :

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		long T = in.nextLong();
		while (T-- != 0) {
			long total = 0, F = in.nextLong();
			while (F-- != 0) {
				long size = in.nextLong(), number = in.nextLong(), envir = in.nextLong();
				total += size * envir;
			number--;
			}
			System.out.println(total);
		}
	}
}
Advertisements

One thought on “UVA – 10300 – Ecological Premium

  1. why used long
    went right with unsigned int and int

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: