UVA 10213(p336)----How Many Pieces of Land
来源:互联网 发布:c语言简易计算器 编辑:程序博客网 时间:2024/04/29 21:39
import java.io.*;import java.util.*;import java.math.*;public class Main{ static PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out))); public static void main(String args[]) throws IOException { Scanner cin=new Scanner(System.in); int kase = cin.nextInt(); for(int c = 1; c <= kase; ++c) { BigInteger ans = BigInteger.valueOf(1); String s = cin.next(); BigInteger n = new BigInteger(s); BigInteger temp = new BigInteger(s); temp = temp.multiply(temp.subtract(new BigInteger("1"))); temp = temp.divide(new BigInteger("2")); ans = ans.add(temp); temp = temp.multiply(n.subtract(new BigInteger("2"))); temp = temp.multiply(n.subtract(new BigInteger("3"))); temp = temp.divide(new BigInteger("12")); ans = ans.add(temp); System.out.println(ans); } }}
0 0
- UVA 10213(p336)----How Many Pieces of Land
- uva 10213 how many pieces of land
- UVA-10213 How many pieces of land
- UVa 10213 How Many Pieces of Land?
- UVa 10213 How Many Pieces of Land ?
- UVa Problem Solution: 10213 - How Many Pieces of Land?
- UVA 10213 How Many Pieces of Land? 欧拉定理
- uva 10213 How Many Pieces of Land 分割圆 高精度
- UVa 10213 How Many Pieces of Land (欧拉定理)
- How many pieces of land?
- UVa Problem 10213 How Many Pieces of Land? (土地分割)
- UVa 10213 How Many Pieces of Land ? (数学&欧拉公式&高精度)
- 【UVA】10213 - How Many Pieces of Land ?(大树模板X2)
- uva_10213 - How Many Pieces of Land ?
- UVaOj How many pieces of land?
- UVa10213 - How Many Pieces of Land ?
- 110602 How Many Pieces of Land
- How Many Pieces of Land题解
- Android Studio——FrameLayout
- Leet Code OJ 104. Maximum Depth of Binary Tree [Difficulty: Easy]
- Android状态保存与恢复
- drupal mysql
- WebKit之Skia之深入分析
- UVA 10213(p336)----How Many Pieces of Land
- Android 通知栏提示
- 抽象类一个很好的例子
- Linux/Unix下采用dlopen、dlsym、dlclose加载动态链接库
- 一个封装类教你学会SQLite数据库
- 解决iOS9中HTTP请求不能正常使用
- NAT穿越
- 关于wincvs1.3中文版对比版本中文乱码的解决方案
- UVA 10214(p339)----Trees in a Wood