public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int T = in.nextInt();
for (int t = 0; t < T; t++) {
int l = in.nextInt();
int r = in.nextInt();
long n = Math.min(l, r);
long re = (n + 1) * n / 2;
System.out.println("Case #" + (t + 1) + ": " + re);
}
}
Kickstart Practice Round 2017 Problem C. Sherlock and Parentheses
最新推荐文章于 2019-07-01 00:47:16 发布