Created
January 19, 2017 21:54
-
-
Save johirbuet/e86eda6e458c4b2b6aec6213bcb3a405 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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