Problem 318A codeforces solution in c

Revision en1, by mustak1, 2019-09-09 10:32:50

include <stdio.h>

int main() { long long n,k,j,i; scanf("%lld%lld",&n,&k); if(n%2==0) j=n/2; else j=n/2+1; if(k<=j) i=(k*2)-1; else i=(k-j)*2; printf("%lld\n",i); return 0; }

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English mustak1 2019-09-09 10:33:37 1 (published)
en1 English mustak1 2019-09-09 10:32:50 241 Initial revision (saved to drafts)