B. Ternary Logic(三进制)
time limit per test 2 secondsmemory limit per test 256 megabytesinput standard inputoutput standard outputLittle Petya very much likes computers. Recently he has received a new “Ternatron IV” as a...