Skip to content

Instantly share code, notes, and snippets.

@johirbuet
Created January 19, 2017 21:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johirbuet/e86eda6e458c4b2b6aec6213bcb3a405 to your computer and use it in GitHub Desktop.
Save johirbuet/e86eda6e458c4b2b6aec6213bcb3a405 to your computer and use it in GitHub Desktop.
import java.math.BigInteger;
import java.util.Scanner;
public class UVA10300 {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int T=sc.nextInt();
while(T-->0)
{
int f=sc.nextInt();
BigInteger sum=BigInteger.ZERO;
for(int i=0;i<f;i++)
{
long s=sc.nextInt();
long a=sc.nextInt();
long ef=sc.nextInt();
sum=sum.add(BigInteger.valueOf(s*ef));
}
System.out.println(sum.toString());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment