|
|
|
@ -0,0 +1,19 @@ |
|
|
|
import java.math.BigInteger; |
|
|
|
public class LargeIntegers { |
|
|
|
public void oneOfThree( BigInteger a, BigInteger b, BigInteger c ){ |
|
|
|
BigInteger res; |
|
|
|
BigInteger TWO = new BigInteger("2"); |
|
|
|
if (a.compareTo(b) == 0){ |
|
|
|
res = a.multiply(b).multiply(c); |
|
|
|
} |
|
|
|
else { |
|
|
|
if (c.mod(TWO).compareTo(BigInteger.ZERO) == 0) { |
|
|
|
res = a.min(b); |
|
|
|
} |
|
|
|
else { |
|
|
|
res = a.max(b); |
|
|
|
} |
|
|
|
} |
|
|
|
System.out.println("Output: " + res); |
|
|
|
} |
|
|
|
} |