Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
11
int main()
12
13
{
14
15
16
long long n,k;
17
cin>>n>>k;
18
if(k<=(n+1)/2){
19
cout<<2*k-1;
20
}
21
else{
22
cout<<(k-(n+1)/2)*2;
23
}
24
return 0;
25
}
Callers
nothing calls this directly
Calls
no outgoing calls
Tested by
no test coverage detected