Home » Java » Zhongkai ACM 1075: the slow need to start early. [...

Zhongkai ACM 1075: the slow need to start early. [Java]

Title Description


A lot is a rookie, said a lot to the slow need to start early., rookie to fly. So it from 0 points of view, the beginning of the flight speed of 1m/s, every time a lot of units flying faster than on a per unit time flight speed 2m/s, ask n (0
Input format


First enter an integer T, indicating that there are several sets of data. Each group of data input a n, indicating a lot of flight time,.


output


How much output is flying, because the numbers are great, so take 10000 to.


sample input


2

1

2


sample output


1


4


this is actually a first 1. tolerance is the sum of 2 arithmetic progression, sequence and formula (1+2n-1) *n/2=n^2.

package acm;
Import java.util.Scanner;
Public class {the slow need to start early.
Public static void main (String [] args)
{
Scanner input = new Scanner (System.in);
Int a = input.nextInt ();
For (int i = 0; I < A; i++)
{
Int b = input.nextInt ();
Int c = b * B% 10000;
System.out.println (C);
}
}
}


Latest