链接:https://codeforces.com/problemset/problem/84/A
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
Copy
2
output
Copy
3
input
Copy
4
output
Copy
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.
写这道题题解不是因为它难,毕竟cfA题不是吗
主要是因为感觉这道题挺有意思,大致题意是两个军队士兵互打,每个军队各有N个士兵,每次可以指定每个士兵攻击另一个军队的任意目标,打中即死,先由A军队攻击再由B军队攻击最后A军队攻击。问最多死多少人。
题解:B肯定全军覆没,A肯定死一半。
#include<bits/stdc++.h>
using namespace std;
long long n;
int main()
{
cin>>n;
cout<<n/2+n;
}