Submit | All submissions | Best solutions | Back to list |
EIUSUFBF - Friend suggestion |
An want to make friends with students in EIU on Facebook. Observing students on the university's Facebook group, they have few friends. Therefore, An will make friend suggestion for friends who have less than L friends. He also hope his friends too. Help him to write a program to help the user make friend find out his/her friends who have less than L friends.
Input
The first line contains 3 integers N, respectively, the number of students in the group (numbered from 0 to N-1), the number of friendships, and the minimum number of friends a person should have. (0 < N ≤ 104), M (0 ≤ M ≤ 105), L (0 < N ≤ 103)
In the next M lines, each line is a number u and v, showing that you and v are friends.
Output
Output student in ascending order and list friends who the student should send suggestion to. The list friends in ascending order.
Example
Input: 5 6 3 0 3 3 1 1 2 0 1 3 4 4 2 Output: 0 1 0 2 2 4 3 0 4 4 2
Added by: | Ha Minh Ngoc |
Date: | 2017-08-25 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: GOSU |