#include #include typedef long long ll; int n, w; ll h; ll bh[100000+1]; int solve(void) { int a, b, x, i, j, ret=-1, rest; int score[2]={0, 0}; rest=w; memset(bh, 0, sizeof(bh)); for(i=0;i=0) continue; for(j=0;j=h) { score[i%2]++; rest--; if(!rest) { if(score[0]==score[1]) ret=0; if(score[0]>score[1]) ret=1; if(score[0]