Time Limit: 1000MS
Memory Limit: 65536K
a. the official works on the 1st floor; b. the document is signed by the official working in the room with the same number but situated one floor below; c. the document is signed by an official working in a neighbouring room (rooms are neighbouring if they are situated on the same floor and their numbers differ by one).Each official collects a fee for signing a document. The fee is a positive integer not exceeding 10^9. You should find the cheapest way to approve the document.