#K80287. Influencer Finder
Influencer Finder
Influencer Finder
You are given a social network with \(n\) users labeled from 1 to \(n\) and \(m\) follow connections. Each connection is represented as a pair \( (a, b) \) meaning user \(a\) follows user \(b\). The task is to determine the influencer, defined as the user who has the maximum number of followers. In the case of a tie, choose the user with the smallest user ID.
If there are no follow connections (i.e., \(m = 0\)), your program should output INF
as there is no influencer.
Note: Ensure your program reads input from stdin
and writes the answer to stdout
.
inputFormat
The first line contains two integers (n) and (m) (number of users and number of follow connections, respectively). Each of the next (m) lines contains two integers (a) and (b) indicating that user (a) follows user (b).
outputFormat
Output a single line containing the user ID of the influencer. If there are no follow connections, output INF
.## sample
5 4
1 3
2 3
4 3
5 2
3
</p>