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:
cities in Byteland, numbered from
to
.
roads.
Write a program that:
and
from the standard input,
The first and only line of input contains two integers
and
(
,
), separated with a single space.
If no road network plan exists for the values of parameters
and
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
lines.
Each line should contain a description of one bidirectional road -
two different integers in the range from
to
, 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.
For the input data:
6 3
the correct result is:
1 3 2 3 3 4 4 5 4 6

Task author: Jakub Radoszewski.
W razie problemów technicznych ze Szkopułem, prosimy o kontakt mailowy pod adresem szkopul@fri.edu.pl.
Jeśli chciałbyś porozmawiać o zadaniach, rozwiązaniach lub problemach technicznych, odwiedź nasze serwery na Discordzie. Są one moderowane przez społeczność, ale członkowie zespołu wsparcia również aktywnie się tam udzielają.