ZCMU--2219: Toy Army(C语言)

The hero of our story, Valera, and his best friend Arcady are still in school, and therefore they spend all the free time playing turn-based strategy "GAGA: Go And Go Again". The gameplay is as follows.

There are two armies on the playing field each of which consists of n men (n is always even). The current player specifies for each of her soldiers an enemy's soldier he will shoot (a target) and then all the player's soldiers shot simultaneously. This is a game world, and so each soldier shoots perfectly, that is he absolutely always hits the specified target. If an enemy soldier is hit, he will surely die. It may happen that several soldiers had been indicated the same target. Killed soldiers do not participate in the game anymore.

The game "GAGA" consists of three steps: first Valera makes a move, then Arcady, then Valera again and the game ends.

You are asked to calculate the maximum total number of soldiers that may be killed during the game.

Input

The input data consist of a single integer n (2≤n≤108, n is even). Please note that before the game starts there are 2n soldiers on the fields.

Output

Print a single number − a maximum total number of soldiers that could be killed in the course of the game in three turns.

Examples

Input

2

Output

3

Input

4

Output

6

Note

The first sample test:

1) Valera's soldiers 1 and 2 shoot at Arcady's soldier 1.

2) Arcady's soldier 2 shoots at Valera's soldier 1.

3) Valera's soldier 1 shoots at Arcady's soldier 2.

There are 3 soldiers killed in total: Valera's soldier 1 and Arcady's soldiers 1 and 2.

题目大意:

赛场上有两支军队,每支军队由n人组成(n总是偶数)。当前玩家为她的每个士兵指定一个他将射击的敌方士兵(一个目标),然后同时射击该玩家的所有士兵。这是一个游戏世界,所以每个士兵都能完美地射击,那就是他绝对总是击中指定的目标。敌军被击中,必死无疑。可能会发生几个士兵被指示同一个目标的情况。被杀的士兵不再参与游戏。

游戏“GAGA”由三个步骤组成:首先 Valera 出手,然后是 Arcady,然后是 Valera,然后游戏结束。

您被要求计算在三个回合中可能被杀死的士兵的最大总数。

解析:n等于2时候我们好思考,2打2,最大值死亡数为3,题目说了n为偶数,所以我们可以看成若干的2打2的小区域,因此答案就是(n/2)*3;

#include 
int main()
{
	long long n;
 	while(~scanf("%lld",&n)){
 		printf("%lld\n",n/2*3);
	 }
    return 0;
}

你可能感兴趣的:(c语言)