意思是 有两组部队,V军和A军,V军先攻击然后轮到A军然后轮到V军。每个军人每次只能打死一个敌人但是必中必死,问就这三轮攻击最多死多少人。
死的最多即活着的最少。最后一轮攻击后假设或者k个人,那么他们在最后一轮攻击的时候杀了敌人的k个人且是敌军的最后k个人,而这k个人活着的时候杀了这半边的k个人,再向前追溯一次就是第一次V军攻击的结果是:这边有2k个人,杀了对面一些人之后对面剩下k个,因为两边最初都是n个人,为了让杀的人最多,那么2k=n,所以死了3k的人,即n的1.5倍。
读入然后输出1.5倍即可。
#include <iostream>
using namespace std;
// http://codeforces.com/contest/84
// Toy Army
int main()
{
int n;
cin>>n;
cout<<n/2*3;
return 0;
}