D - Poor Sense of Direction

2 secs 1024 MB
loop0919's icon loop0919

2-testcase17.txt


入力

出力