Under construction

Still being built. Things may change

Satan Game

Time limit2sMemory limit512 MB

Summary
Output a board with N up to 100, M up to 20, and snakes and ladders so the expected number of dice rolls to finish is at least 5e18.
Level

Hard8 of 10

Topics
Probability, Math, Implementation
Solved
No attempts yet

Problem

A snakes and ladders game is a well-known dice game. At the start, the piece is off the board. At the start of each turn, roll an MM-sided die. Each natural number from 1 to MM comes up with probability 1/M1/M. Move the piece forward by the number rolled. If the piece is off the board, it moves to the cell matching the rolled number. If the cell has a snake or ladder, the piece moves to the cell it points to. The game ends when the piece reaches cell NN. Reaching past cell NN also counts as finishing.

This problem invites a natural question. "What is the expected number of dice rolls needed to finish?" But we are not solving that problem. We need to build a test case for it.

Create a test case whose answer is 50,000,000,000,000,000,000 or greater.

Input

There is no input.

Output

On the first line, print three natural numbers NN, MM, and SS. NN is at most 100, MM is at most 20, and SS is at most N/2N/2.

On each of the next SS lines, print the start and end points of one snake or ladder. If the end point is less than the start point, it is a snake. If it is greater, it is a ladder. The start point must be between 1 and N−1N-1, and the end point must be between 1 and NN. No point may repeat among all start and end points.

The game must be finishable no matter which cell the piece is placed on. This includes placing the piece on a cell that cannot be reached at all, or starting on the start of a snake or ladder without taking it. The condition is hard to make sense of, but this is the Gudegi Cup, so go with it.

Examples1

  1. Example 1

    Input
    Expected output
    4 2 1
    2 4