BISHOPS  Bishops
Yesterday was Sam's birthday. The most interesting gift was definitely the chessboard. Sam quickly learned the rules of chess and defeated his father, all his friends, his little sister, and now no one wants to play with him any more.
So he decided to play with another birthday gift – a Book of Math Problems for Young Mathematicians. He opened the book somewhere in the middle and read the following problem: "How many knights can be placed on a chessboard without threatening each other?" After a while he realized that this was trivial and moved on to the next problem: "How many bishops can be placed on a chessboard without threatening each other?". Sam is in trouble here. He is not able to solve this problem and needs your help.
Sam's chessboard has size N x N. A bishop can move to any distance in any of the four diagonal directions. A bishop threatens another bishop if it can move to the other bishop's position. Your task is to compute the maximum number of bishops that can be placed on a chessboard in such a way that no two bishops threaten each other.
Input
The input file consists of several lines. The line number i contains a single positive integer N representing the size of the ith chessboard. [1 <= N <= 10^100]
Output
The output file should contain the same number of lines as the input file. The ith line should contain one number – the maximum number of bishops that can be placed on ith chessboard without threatening each other.
Example
Input: 2 3 Output: 2 4
hide comments
anurag_lal1:
20170110 12:44:56
Thanx for reminding case n=1, got 1WA. Finally ac..:) 

aman_agarwal19:
20170104 19:26:22
I dont know but is it only me who has written 55 line code(in C) everyone else sayin 23 lines :( 

praney_rai:
20161228 21:46:24
such a frustrating question..!! ac after 1 WA, 1NZEC 

vengatesh15:
20161226 15:11:34
AC in 1 go


ankitabk:
20161211 08:07:03
for c++, while(getline(cin,s))


aditya_rev:
20161115 07:26:10
very challanging in c/c++, my 40th :") 

angel_of_death:
20161022 05:52:19
piyush_arora1 thanks for reminding about the test case where n=1. Costed me 1 WA. 

yocoders:
20161011 05:35:11
some more test cases please :p


hamjosh1:
20161002 14:13:16
Python ;) 

young_padawan:
20160915 16:09:47
guys help i am getting tle in c++.Am using scanf and printf also... 
Added by:  Roman Sol 
Date:  20050417 
Time limit:  1s 
Source limit:  10000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All 
Resource:  IPSC 2004 