Petya rectangular Board size n time m initially k chip place board ith chip locate cell intersection sx_ith row sy_ith columnin action Petya chip leave right 1 cellIf chip x y cell operation leave coordinate x y 1 right coordinate x y 1 coordinate x 1 y coordinate x 1 y if chip locate wall board action choose Petya move wall chip remain current positionnote chip locate cellFor chip Petya choose position visit note necessary chip end positionsince Petya lot free time ready 2 nm actionsYou find action Petya chip visit position Petya select or determine possible 2 nm action