REVIEW - Peer Review

For scientific conferences, scientists submit papers presenting their ideas, and then review each other’s papers to make sure only good papers are presented at the conference. Each paper must be reviewed by at least one scientist, and scientists must not review papers written by people they collaborate with (including themselves), or review the same paper more than once.

You have been asked to write a program to check if your favorite conference is doing things right. Whether a paper is being reviewed too much, too little, or by the wrong people - the organizers must know before it is too late!

Input

The first line in each test case has two integers, K (1 ≤ K ≤ 5) and N (1 ≤ N ≤ 1000). K is the number of reviews that each paper will receive, while N is the number of papers to be reviewed. The conference only accepts papers with a single author, and authors can only present a single paper at the conference.

Each of the next N lines describes an author and includes the name of the institution to which the author belongs, followed by the list of the K papers he or she has been requested to review. It is assumed that researchers from the same institution collaborate with each other, whereas researchers from different institutions don’t. All institution names are shorter than 10 characters, and contain only upper or lowercase letters and no whitespace. Since we have as many papers as authors, papers are identified by their author’s index; paper 1 was written by the first author in the list, and paper N was written by the last author.

The end of the test cases is marked with a line containing K=0 and N=0. You should generate no output for this line.

Output

For each test case, your program should output NO PROBLEMS FOUND (if all rules are being followed) or P PROBLEMS FOUND, where P is the number of rule violations found (counting at most 1 violation per paper). If there is exactly one rule violation overall, your program should output 1 PROBLEM FOUND.

Sample Input

2 3
UCM 2 3
UAM 1 3
UPM 1 2
2 3
UCM 2 3
UAM 1 2
UPM 2 2
0 0

Sample Output

NO PROBLEMS FOUND
3 PROBLEMS FOUND

Problemsetter: Manuel Freire

Added by:David García Soriano
Date:2011-11-26
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64
Resource:Southwestern Europe Regional, SWERC 2011

hide comments
2014-07-24 08:57:37 Satyaki Upadhyay
Should the total reviews for each paper be exactly k or can it be more? If it is more, then some other paper must have less than k. In that case, the second one has a problem but does the first one too?
Please explain the problem properly!!

Last edit: 2014-07-24 08:57:57
2012-11-09 11:18:15 David García Soriano
@:D
Again, how is the sentence "Each paper must be reviewed by at least one scientist" misleading?
And what do you mean by the "K reviews" rule?

Last edit: 2012-11-09 11:21:50
2012-08-10 23:06:41 smiley007
:P easy problem....
2012-06-10 17:02:49 :D
The description is not misleading, but is downright lying about the problem! There should be EXACTLY K reviews for every paper. Not only do we have the "... one scientist." in the first paragraph, but the input description says "K is the number of reviews that each paper will receive", when it should be "... should receive" witch has a completely different meaning. I though it was just an error, as later K is the number of reviews per reviewer. As a result the "K reviews" rule is not even hinted, when it should be clearly explained.

It's also really sad, that for half a year and almost 60 submission no one took a minute to clarify this!
2012-04-13 18:40:15 David García Soriano
@BX: How so?
2012-04-11 02:09:49 suhang
"Each paper must be reviewed by at least one scientist" is misleading
2011-12-11 20:00:57 Aman Kumar
finally AC :) remember to convert the data in terms of papers first ! it is given in terms of authors.....got loads of WAs for that....


Last edit: 2011-12-12 12:35:28
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.