Rosetta Problems

Negative Cycle

https://atcoder.jp/contests/agc036/tasks/agc036_d