Print a fixed 4-vertex, 5-edge flow network with the exact edges and capacities given in the statement.
Easy1GraphImplementationSimulationNo attempts yetTime limit2sMemory limit512 MBJigoo always solves maximum-flow problems with the Edmonds-Karp algorithm. One day Jigoo saw a flow problem with 500 vertices and 100000 edges. Jigoo built a flow graph, wrote about 2000 bytes of code, and submitted it, but the cheerful green "Accepted!!" text did not appear. Tired of optimizing the code, Jigoo found Dinic's algorithm, whose worst-case time complexity is O(V2E).
Dinic's algorithm is simpler than it first seems.
The time complexity of Dinic is O(V2E). The proof is as follows.
There was still a problem. Jigoo implemented the algorithm carefully and still did not see the green text. In the end Jigoo gave up on that problem together with Dinic.
A few days later, Dotori happened to look at Jigoo's Dinic code and pointed out a small mistake that caused many useless operations and made the program slow. Jigoo fixed the code and finally saw the beautiful green text.
Jigoo still found something odd. The number of edges is at most V2, so Dinic is O(V4), and 500 vertices should time out. Jigoo could not construct a slow test.
Originally any flow graph that makes Dinic slow would be accepted. To fix a unique answer, print the following graph.
There are 4 vertices and 5 edges. Flow is sent from vertex 1 to vertex 4. Print the edges in this order with these capacities.
There is no input. If standard input is present, ignore it.
Print the number of vertices N and the number of edges M on the first line, separated by a space.
On each of the next M lines, print the start vertex s, the end vertex e, and the capacity f, separated by spaces.
The output must be exactly N=4, M=5, with the edges in the order and capacities fixed in the statement.