A. Toy army

Source: Internet
Author: User
Time limit per test

2 seconds

Memory limit per test

256 megabytes

Input

Standard Input

Output

Standard output

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 consistsNMen (NIs
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 particle 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 integerN(2 cores ≤ CoresNLimit ≤ limit 108,NIs
Even). Please note that before the game starts there are 2NSoldiers on the fields.

Output

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

Sample test (s) 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.

Problem-solving Description: The question shows that there must be three times of shooting. the maximum number of dead soldiers is required. One of them must be all killed, at least N. The worst case is that the other is half killed, 3/2 N in total

#include<stdio.h>int main(){int n,result;scanf("%d",&n);result=(n/2)*3;printf("%d",result);return 0;}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.