The first line contains two integers N and P, the number of researchers and the number of pairs. Each of the next P lines contains 2 space-separated integers denoting researcher ID's with the same nationality. The researchers are numbered 0 through N-1. the researcher is from a different country which only have one researcher. It could be multi countries that only have one researcher.
For example,
4 2
1 2
2 3
The first line contains N and P information which is 4 researchers and 2 pairs of researchers. researchers by country are [0] (which is not it found in pair list) and [1,2,3]. There are 3 pairs to choose from: [0,1],[0,2] and [0,3].
Input Format
The first line contains two integers N and P, the number of researchers and the number of pairs.
Each of the next P lines contains 2 space-separated integers denoting researcher ID's with the same nationality.
Constraints
n, p = map(int, input('Enter N and P: ').split())
n = list(range(1, n))
for i in range(p):
print(n[i], n[i + 1])
Comments
Leave a comment