| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 128 MB | 7 | 0 | 0 | 0.000% |
Byteman is going for a car trip around Byteland, but he is unfortunately unable to buy a map of the country. From his friends he learned about some properties of the bytean road network:
Using information that he managed to collect, Byteman is going to try to reconstruct the road map of Byteland. The total number of theoretically possible road network plans satisfying the given conditions may be quite big, so any correct plan will be enough for Byteman.
Write a program that:
The first and only line of input contains two integers n and d (2 ≤ n ≤ 200, 0 ≤ d < n), separated with a single space.
If no road network plan exists for the values of parameters n and d from the input, the first and only line of output should contain a single word BRAK (i.e. none in Polish). In the opposite case the output should consist of n - 1 lines. Each line should contain a description of one bidirectional road - two different integers in the range from 1 to n, separated with a single space and denoting the numbers of cities connected by this road. The order of roads and numbers of cities connected by roads in the output can be arbitrary.
6 3
1 3 2 3 3 4 4 5 4 6
Contest > Algorithmic Engagements > PA 2008 7-6번