oartihsin's blog

By oartihsin, history, 5 years ago, In English

black has to travel n-x distance row-wise and n-y distance column wise to reach the coin at (x,y). Hence total distance travelled by black is b = n-x + n-y. Similary white has to travel x-1 distance row wise and y-1 column wise. Total distance travelled by white is w = x-1 + y-1. if(b<w) answer is black. else answer is white(if(w<b) it is obvious ... but if b==w then white reaches first as white starts the game and is always a move ahead of black) -

  • Vote: I like it
  • -2
  • Vote: I do not like it