MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / main

Function main

CPP/Maths/EvenOdds.cpp:11–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9
10
11int main()
12
13{
14
15
16long long n,k;
17cin>>n>>k;
18if(k<=(n+1)/2){
19 cout<<2*k-1;
20}
21else{
22 cout<<(k-(n+1)/2)*2;
23}
24return 0;
25}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected