Problem Description Loading... Problem Analysis Find the pattern, and it’s a one-liner kill.
[CodeForces] [638A] Home NumbersProblem Description Loading...Problem AnalysisFind the pattern, and it’s a one-liner kill.cpp1 2 3 4 5 6 7 #include<stdio.h> int main() { int n,a; while(scanf("%d %d",&n,&a)!=EOF) printf("%d\n",a&1?(a-1)/2+1:(n-a)/2+1); return 0; }Problem link:【CodeForces】[638A]Home Numbers