- import java.math.BigInteger;
- import java.util.Scanner;
- /**
- * Created by mahim on 6/17/17.
- */
- import java.math.BigInteger;
- import java.util.Scanner;
- //import static java.lang.System.*;
- class Main{
- public static void main(String args[])
- {
- Scanner sc=new Scanner(System.in);
- int i=sc.nextInt();
- for(int j=1;j<=i;j++)
- {
- int t=sc.nextInt();
- BigInteger one=sc.nextBigInteger();
- BigInteger two=sc.nextBigInteger();
- BigInteger pre=(one.multiply(two)).divide(one.gcd(two));
- for(int u=3;u<=t;u++)
- {
- BigInteger n=sc.nextBigInteger();
- pre=(pre.multiply(n)).divide(pre.gcd(n));
- }
- System.out.println("Case "+j+": "+pre);System.gc();
- }
- }
- }
- /*
- class eid {
- public static void main(String[] args){
- Scanner sc = new Scanner(System.in);
- int ts = sc.nextInt();
- for(int p = 1; p <= ts; p++){
- int n = sc.nextInt();
- BigInteger ans = sc.nextBigInteger();
- BigInteger ans2 = sc.nextBigInteger();
- BigInteger pre = (ans.multiply(ans2)).divide(ans.gcd(ans2));
- for(int i = 2; i <n; i++){
- BigInteger num = sc.nextBigInteger();
- pre = (pre.multiply(num)).divide(pre.gcd(num));
- }
- System.out.println("Case "+p+": "+pre);System.gc();
- }
- }
- }
- */
Saturday, 29 July 2017
Lightoj 1024 - Eid
Subscribe to:
Post Comments (Atom)
Most Featured Post
Lightoj 1159 - Batman
http://lightoj.com/volume_showproblem.php?problem=1159 problem analysis: First i thought of this as if s1, s2 and s3 are those three str...
-
http://lightoj.com/volume_showproblem.php?problem=1382 Problem analysis: This is a rare problem i wrote about so far. After much strugg...
-
http://lightoj.com/volume_showproblem.php?problem=1159 problem analysis: First i thought of this as if s1, s2 and s3 are those three str...
No comments:
Post a Comment