Vanya decide walk field size nn cell the field contain m apple tree ith apple tree cell coordinate xiyi Vanya move vector dxdy that mean Vanya cell xy second cell the following condition satisfy vector large integer divide b Vanya end path reach square visit Vanya wonder square field start path apple tree possible