For problem statement at 0-999/400-499/460-469/460/problemE.txt this is a correct solution, but verifier at 0-999/400-499/460-469/460/verifierE.go ends with runtime: goroutine stack exceeds 1000000000-byte limit
runtime: sp=0x4020260340 stack=[0x4020260000, 0x4040260000]
fatal error: stack overflow
runtime stack:
runtime.throw({0x10f450?, 0x3d850?})
/usr/local/go/src/runtime/panic.go:1094 +0x34 fp=0x4000057e80 sp=0x4000057e50 pc=0x7efe4
runtime.newstack()
/usr/local/go/src/runtime/stack.go:1159 +0x44c fp=0x4000057fb0 sp=0x4000057e80 pc=0x67d5c
runtime.morestack()
/usr/local/go/src/runtime/asm_arm64.s:392 +0x70 fp=0x4000057fb0 sp=0x4000057fb0 pc=0x83700
goroutine 1 gp=0x40000021c0 m=3 mp=0x4000041008 [running]:
main.dfs({0x4000220000?, 0x5?, 0x8?}, 0x2?, 0x0?, {0x400d066000?, 0x2aaaa1?, 0x33ba00?}, 0x404025fc60, 0x404025fc58?)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:35 +0x2a0 fp=0x4020260340 sp=0x4020260340 pc=0xd6c20
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020260400 sp=0x4020260340 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x40202604c0 sp=0x4020260400 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020260580 sp=0x40202604c0 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020260640 sp=0x4020260580 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020260700 sp=0x4020260640 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x40202607c0 sp=0x4020260700 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020260880 sp=0x40202607c0 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020260940 sp=0x4020260880 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020260a00 sp=0x4020260940 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020260ac0 sp=0x4020260a00 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020260b80 sp=0x4020260ac0 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020260c40 sp=0x4020260b80 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020260d00 sp=0x4020260c40 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020260dc0 sp=0x4020260d00 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020260e80 sp=0x4020260dc0 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020260f40 sp=0x4020260e80 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020261000 sp=0x4020260f40 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x40202610c0 sp=0x4020261000 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020261180 sp=0x40202610c0 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020261240 sp=0x4020261180 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020261300 sp=0x4020261240 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x40202613c0 sp=0x4020261300 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020261480 sp=0x40202613c0 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020261540 sp=0x4020261480 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020261600 sp=0x4020261540 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x40202616c0 sp=0x4020261600 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020261780 sp=0x40202616c0 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020261840 sp=0x4020261780 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020261900 sp=0x4020261840 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x40202619c0 sp=0x4020261900 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020261a80 sp=0x40202619c0 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020261b40 sp=0x4020261a80 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020261c00 sp=0x4020261b40 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020261cc0 sp=0x4020261c00 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020261d80 sp=0x4020261cc0 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020261e40 sp=0x4020261d80 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020261f00 sp=0x4020261e40 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020261fc0 sp=0x4020261f00 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020262080 sp=0x4020261fc0 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020262140 sp=0x4020262080 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020262200 sp=0x4020262140 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x40202622c0 sp=0x4020262200 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020262380 sp=0x40202622c0 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020262440 sp=0x4020262380 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020262500 sp=0x4020262440 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x40202625c0 sp=0x4020262500 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020262680 sp=0x40202625c0 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020262740 sp=0x4020262680 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400d066000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x4020262800 sp=0x4020262740 pc=0xd6b00
...2796099 frames elided...
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400022c000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025db00 sp=0x404025da40 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400022c000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025dbc0 sp=0x404025db00 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400022c000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025dc80 sp=0x404025dbc0 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400022c000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025dd40 sp=0x404025dc80 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400022c000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025de00 sp=0x404025dd40 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400022c000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025dec0 sp=0x404025de00 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400022c000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025df80 sp=0x404025dec0 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400022c000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025e040 sp=0x404025df80 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x40000901a8?, {0x400022c000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025e100 sp=0x404025e040 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x4000090228?, {0x400022c000?, 0x2155a0?, 0x24590?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025e1c0 sp=0x404025e100 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x40000902d8?, {0x400022c000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025e280 sp=0x404025e1c0 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0xf8360?, {0x400022c000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025e340 sp=0x404025e280 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400020e200?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025e400 sp=0x404025e340 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400020e200?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025e4c0 sp=0x404025e400 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400020e200?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025e580 sp=0x404025e4c0 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400020e200?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025e640 sp=0x404025e580 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400020e200?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025e700 sp=0x404025e640 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400020e200?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025e7c0 sp=0x404025e700 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400020e200?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025e880 sp=0x404025e7c0 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400020e200?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025e940 sp=0x404025e880 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400020e200?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025ea00 sp=0x404025e940 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400020e200?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025eac0 sp=0x404025ea00 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400020e200?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025eb80 sp=0x404025eac0 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400020e200?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025ec40 sp=0x404025eb80 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400020e200?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025ed00 sp=0x404025ec40 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400020e200?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025edc0 sp=0x404025ed00 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x4000226ed8?, {0x400020e200?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025ee80 sp=0x404025edc0 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400020e200?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025ef40 sp=0x404025ee80 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400022a000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025f000 sp=0x404025ef40 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400022a000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025f0c0 sp=0x404025f000 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400022a000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025f180 sp=0x404025f0c0 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x400022a000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025f240 sp=0x404025f180 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x40002273a8?, {0x400022a000?, 0x2000?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025f300 sp=0x404025f240 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x4000227428?, {0x400022a000?, 0x2155a0?, 0x24590?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025f3c0 sp=0x404025f300 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x40002274d8?, {0x400022a000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025f480 sp=0x404025f3c0 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0xd?, {0x400022a000?, 0x0?, 0x0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025f540 sp=0x404025f480 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0xc?, {0x4000220080?, 0x400006c6b8?, 0x2789c?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025f600 sp=0x404025f540 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x400006c758?, {0x4000220080?, 0x400006c748?, 0xcc784?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025f6c0 sp=0x404025f600 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x400006c7d8?, {0x4000220080?, 0x4?, 0x1?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025f780 sp=0x404025f6c0 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x13d528?, {0x4000220080?, 0x400006c8c8?, 0xcd398?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025f840 sp=0x404025f780 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x400006c958?, {0x400021e080?, 0x400006c968?, 0x7ddb0?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025f900 sp=0x404025f840 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x400006ca38?, {0x400021e080?, 0x400006ca38?, 0x2db00?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025f9c0 sp=0x404025f900 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x400006cad8?, {0x400006cbc8?, 0x30006cae8?, 0xffff744626e8?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025fa80 sp=0x404025f9c0 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x400006cbd8?, {0x400006cbc8?, 0x2155a0?, 0xffffbb0fdaa8?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025fb40 sp=0x404025fa80 pc=0xd6b00
main.dfs({0x4000220000, 0x5, 0x8}, 0x2, 0x0?, {0x0?, 0x0?, 0x1?}, 0x404025fc60, 0x404025fc58)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:60 +0x180 fp=0x404025fc00 sp=0x404025fb40 pc=0xd6b00
main.expectedE(0x2, 0x400020a060?)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:69 +0x54 fp=0x404025fc80 sp=0x404025fc00 pc=0xd6c94
main.runCase({0xffffda686d6a, 0x1c}, 0x2, 0x1)
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:95 +0x424 fp=0x404025fe00 sp=0x404025fc80 pc=0xd70e4
main.main()
/home/ubuntu/codeforces/0-999/400-499/460-469/460/verifierE.go:129 +0x1c8 fp=0x404025ff40 sp=0x404025fe00 pc=0xd74f8
runtime.main()
/usr/local/go/src/runtime/proc.go:285 +0x278 fp=0x404025ffd0 sp=0x404025ff40 pc=0x4e058
runtime.goexit({})
/usr/local/go/src/runtime/asm_arm64.s:1268 +0x4 fp=0x404025ffd0 sp=0x404025ffd0 pc=0x85934
goroutine 2 gp=0x4000002700 m=nil [force gc (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
/usr/local/go/src/runtime/proc.go:460 +0xc0 fp=0x400003af90 sp=0x400003af70 pc=0x7f0f0
runtime.goparkunlock(...)
/usr/local/go/src/runtime/proc.go:466
runtime.forcegchelper()
/usr/local/go/src/runtime/proc.go:373 +0xb4 fp=0x400003afd0 sp=0x400003af90 pc=0x4e3a4
runtime.goexit({})
/usr/local/go/src/runtime/asm_arm64.s:1268 +0x4 fp=0x400003afd0 sp=0x400003afd0 pc=0x85934
created by runtime.init.7 in goroutine 1
/usr/local/go/src/runtime/proc.go:361 +0x24
goroutine 3 gp=0x4000002fc0 m=nil [GC sweep wait]:
runtime.gopark(0x1?, 0x0?, 0x0?, 0x0?, 0x0?)
/usr/local/go/src/runtime/proc.go:460 +0xc0 fp=0x400003b760 sp=0x400003b740 pc=0x7f0f0
runtime.goparkunlock(...)
/usr/local/go/src/runtime/proc.go:466
runtime.bgsweep(0x400001e080)
/usr/local/go/src/runtime/mgcsweep.go:323 +0x104 fp=0x400003b7b0 sp=0x400003b760 pc=0x399f4
runtime.gcenable.gowrap1()
/usr/local/go/src/runtime/mgc.go:212 +0x28 fp=0x400003b7d0 sp=0x400003b7b0 pc=0x2d908
runtime.goexit({})
/usr/local/go/src/runtime/asm_arm64.s:1268 +0x4 fp=0x400003b7d0 sp=0x400003b7d0 pc=0x85934
created by runtime.gcenable in goroutine 1
/usr/local/go/src/runtime/mgc.go:212 +0x6c
goroutine 4 gp=0x4000003180 m=nil [GC scavenge wait]:
runtime.gopark(0x10000?, 0x13c4d0?, 0x0?, 0x0?, 0x0?)
/usr/local/go/src/runtime/proc.go:460 +0xc0 fp=0x400003bf60 sp=0x400003bf40 pc=0x7f0f0
runtime.goparkunlock(...)
/usr/local/go/src/runtime/proc.go:466
runtime.(*scavengerState).park(0x1ee680)
/usr/local/go/src/runtime/mgcscavenge.go:425 +0x5c fp=0x400003bf90 sp=0x400003bf60 pc=0x3754c
runtime.bgscavenge(0x400001e080)
/usr/local/go/src/runtime/mgcscavenge.go:658 +0xac fp=0x400003bfb0 sp=0x400003bf90 pc=0x37acc
runtime.gcenable.gowrap2()
/usr/local/go/src/runtime/mgc.go:213 +0x28 fp=0x400003bfd0 sp=0x400003bfb0 pc=0x2d8a8
runtime.goexit({})
/usr/local/go/src/runtime/asm_arm64.s:1268 +0x4 fp=0x400003bfd0 sp=0x400003bfd0 pc=0x85934
created by runtime.gcenable in goroutine 1
/usr/local/go/src/runtime/mgc.go:213 +0xac
goroutine 5 gp=0x4000003340 m=nil [finalizer wait]:
runtime.gopark(0x0?, 0x0?, 0xb8?, 0xa5?, 0x7fca4?)
/usr/local/go/src/runtime/proc.go:460 +0xc0 fp=0x400003a580 sp=0x400003a560 pc=0x7f0f0
runtime.runFinalizers()
/usr/local/go/src/runtime/mfinal.go:210 +0x104 fp=0x400003a7d0 sp=0x400003a580 pc=0x2c9a4
runtime.goexit({})
/usr/local/go/src/runtime/asm_arm64.s:1268 +0x4 fp=0x400003a7d0 sp=0x400003a7d0 pc=0x85934
created by runtime.createfing in goroutine 1
/usr/local/go/src/runtime/mfinal.go:172 +0x78
goroutine 6 gp=0x4000003500 m=nil [cleanup wait]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
/usr/local/go/src/runtime/proc.go:460 +0xc0 fp=0x400003c740 sp=0x400003c720 pc=0x7f0f0
runtime.goparkunlock(...)
/usr/local/go/src/runtime/proc.go:466
runtime.(*cleanupQueue).dequeue(0x1ee880)
/usr/local/go/src/runtime/mcleanup.go:439 +0x110 fp=0x400003c780 sp=0x400003c740 pc=0x29a60
runtime.runCleanups()
/usr/local/go/src/runtime/mcleanup.go:635 +0x40 fp=0x400003c7d0 sp=0x400003c780 pc=0x2a210
runtime.goexit({})
/usr/local/go/src/runtime/asm_arm64.s:1268 +0x4 fp=0x400003c7d0 sp=0x400003c7d0 pc=0x85934
created by runtime.(*cleanupQueue).createGs in goroutine 1
/usr/local/go/src/runtime/mcleanup.go:589 +0x108
goroutine 17 gp=0x4000003a40 m=nil [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x50?, 0xe0?, 0x0?)
/usr/local/go/src/runtime/proc.go:460 +0xc0 fp=0x400003d710 sp=0x400003d6f0 pc=0x7f0f0
runtime.gcBgMarkWorker(0x4000276000)
/usr/local/go/src/runtime/mgc.go:1463 +0xe0 fp=0x400003d7b0 sp=0x400003d710 pc=0x2fd00
runtime.gcBgMarkStartWorkers.gowrap1()
/usr/local/go/src/runtime/mgc.go:1373 +0x28 fp=0x400003d7d0 sp=0x400003d7b0 pc=0x2fbe8
runtime.goexit({})
/usr/local/go/src/runtime/asm_arm64.s:1268 +0x4 fp=0x400003d7d0 sp=0x400003d7d0 pc=0x85934
created by runtime.gcBgMarkStartWorkers in goroutine 1
/usr/local/go/src/runtime/mgc.go:1373 +0x140
goroutine 18 gp=0x4000278000 m=nil [GC worker (idle)]:
runtime.gopark(0x2f640e99c0bac?, 0x1?, 0x6d?, 0xa1?, 0x0?)
/usr/local/go/src/runtime/proc.go:460 +0xc0 fp=0x4000205f10 sp=0x4000205ef0 pc=0x7f0f0
runtime.gcBgMarkWorker(0x4000276000)
/usr/local/go/src/runtime/mgc.go:1463 +0xe0 fp=0x4000205fb0 sp=0x4000205f10 pc=0x2fd00
runtime.gcBgMarkStartWorkers.gowrap1()
/usr/local/go/src/runtime/mgc.go:1373 +0x28 fp=0x4000205fd0 sp=0x4000205fb0 pc=0x2fbe8
runtime.goexit({})
/usr/local/go/src/runtime/asm_arm64.s:1268 +0x4 fp=0x4000205fd0 sp=0x4000205fd0 pc=0x85934
created by runtime.gcBgMarkStartWorkers in goroutine 1
/usr/local/go/src/runtime/mgc.go:1373 +0x140
goroutine 19 gp=0x40002781c0 m=nil [GC worker (idle)]:
runtime.gopark(0x2f640e99c07b2?, 0x0?, 0x0?, 0x0?, 0x0?)
/usr/local/go/src/runtime/proc.go:460 +0xc0 fp=0x4000036f10 sp=0x4000036ef0 pc=0x7f0f0
runtime.gcBgMarkWorker(0x4000276000)
/usr/local/go/src/runtime/mgc.go:1463 +0xe0 fp=0x4000036fb0 sp=0x4000036f10 pc=0x2fd00
runtime.gcBgMarkStartWorkers.gowrap1()
/usr/local/go/src/runtime/mgc.go:1373 +0x28 fp=0x4000036fd0 sp=0x4000036fb0 pc=0x2fbe8
runtime.goexit({})
/usr/local/go/src/runtime/asm_arm64.s:1268 +0x4 fp=0x4000036fd0 sp=0x4000036fd0 pc=0x85934
created by runtime.gcBgMarkStartWorkers in goroutine 1
/usr/local/go/src/runtime/mgc.go:1373 +0x140
goroutine 20 gp=0x4000278380 m=nil [GC worker (idle)]:
runtime.gopark(0x2155a0?, 0x3?, 0x87?, 0x9f?, 0x0?)
/usr/local/go/src/runtime/proc.go:460 +0xc0 fp=0x4000206f10 sp=0x4000206ef0 pc=0x7f0f0
runtime.gcBgMarkWorker(0x4000276000)
/usr/local/go/src/runtime/mgc.go:1463 +0xe0 fp=0x4000206fb0 sp=0x4000206f10 pc=0x2fd00
runtime.gcBgMarkStartWorkers.gowrap1()
/usr/local/go/src/runtime/mgc.go:1373 +0x28 fp=0x4000206fd0 sp=0x4000206fb0 pc=0x2fbe8
runtime.goexit({})
/usr/local/go/src/runtime/asm_arm64.s:1268 +0x4 fp=0x4000206fd0 sp=0x4000206fd0 pc=0x85934
created by runtime.gcBgMarkStartWorkers in goroutine 1
/usr/local/go/src/runtime/mgc.go:1373 +0x140
exit status 2 can you fix the verifier? package main
import (
"fmt"
"sort"
)
type Point struct {
x, y int
}
func crossProduct(o, a, b Point) int {
return (a.x-o.x)*(b.y-o.y) - (a.y-o.y)*(b.x-o.x)
}
func convexHull(points []Point) []Point {
sort.Slice(points, func(i, j int) bool {
if points[i].x == points[j].x {
return points[i].y < points[j].y
}
return points[i].x < points[j].x
})
var hull []Point
for _, p := range points {
for len(hull) >= 2 && crossProduct(hull[len(hull)-2], hull[len(hull)-1], p) <= 0 {
hull = hull[:len(hull)-1]
}
hull = append(hull, p)
}
t := len(hull)
for i := len(points) - 2; i >= 0; i-- {
p := points[i]
for len(hull) > t && crossProduct(hull[len(hull)-2], hull[len(hull)-1], p) <= 0 {
hull = hull[:len(hull)-1]
}
hull = append(hull, p)
}
if len(hull) > 1 {
hull = hull[:len(hull)-1]
}
return hull
}
func main() {
var n, r int
if _, err := fmt.Scan(&n, &r); err != nil {
return
}
var points []Point
for x := -r; x <= r; x++ {
for y := -r; y <= r; y++ {
if x*x+y*y <= r*r {
points = append(points, Point{x, y})
}
}
}
hull := convexHull(points)
var dp [9][481][481]int
var parent [9][481][481]Point
for i := 0; i <= n; i++ {
for j := 0; j <= 480; j++ {
for k := 0; k <= 480; k++ {
dp[i][j][k] = -1
}
}
}
dp[0][240][240] = 0
for i := 0; i < n; i++ {
for sx := 0; sx <= 480; sx++ {
for sy := 0; sy <= 480; sy++ {
if dp[i][sx][sy] != -1 {
for _, p := range hull {
nsx := sx + p.x
nsy := sy + p.y
nval := dp[i][sx][sy] + p.x*p.x + p.y*p.y
if nval > dp[i+1][nsx][nsy] {
dp[i+1][nsx][nsy] = nval
parent[i+1][nsx][nsy] = p
}
}
}
}
}
}
maxSum := -1
bestSx, bestSy := -1, -1
for sx := 0; sx <= 480; sx++ {
for sy := 0; sy <= 480; sy++ {
if dp[n][sx][sy] != -1 {
realSx := sx - 240
realSy := sy - 240
val := n*dp[n][sx][sy] - realSx*realSx - realSy*realSy
if val > maxSum {
maxSum = val
bestSx = sx
bestSy = sy
}
}
}
}
fmt.Println(maxSum)
currSx, currSy := bestSx, bestSy
for i := n; i > 0; i-- {
p := parent[i][currSx][currSy]
fmt.Printf("%d %d\n", p.x, p.y)
currSx -= p.x
currSy -= p.y
}
}