BAPPP - Power Play
As we are a “CricketPagol” (loves cricket a lot) nation , we know a lot about Cricket. So Mr. GoodForNothing , a fan of great cricketer Mashrafee think to develop an app that can found an interesting error in the game by visual effect. We all know about power play. Power play is the name for fielding restriction. Suppose, here are the rules of power play in ODI:
- During P-1 (1 to 10 overs) maximum of 2 fielders are allowed outside the inner circle.
- During P-2 (11 to 40 overs) maximum of 4 fielders are allowed outside the inner circle.
- During P-3 (41 to 50 overs) maximum of 3 fielders are allowed outside the inner circle.
You know, there are two circles in the ground. We know that you are a programmer. So, you don’t have to develop the app. For simplifying the problem, you will be given the number of running over. And many pair of cricketer which denotes that they are in the same circle. You have to write a program that will identify that is there error occurs in fielder configuration or not? And we also give you the name of the wicket keeper.
Note that the wicket keeper is always in inner circle. And there can be eleven different cricketer names always.
Input
The first line contains two integer n (1 <= n <= 50) and m (10 <= m <= 50) which denotes that nth over is running now and number of pair of cricketer in the same circle respectively.
The second line contains the name of the wicket keeper.
The next m lines contain m pair of name of the cricketers.
Output
Print “Error” if there are error in fielder configuration. And print “No Error” otherwise.
Example
Input: 3 12 Mushfique Mashrafee Sakib Sakib Mushfique Mashrafee Mushfique Mashrafee Taijul Taijul Mahmudullah Taijul Rubel Mahmudullah Mustafiz Liton Imrul Rubel Mustafiz Liton Anamul Mustafiz Tamim Tamim Sakib Output: Error
Added by: | Bappy |
Date: | 2019-05-07 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All |