 integers n,m,r,t and k(1&lt;=n,m&lt;=500,1&lt;=r,t&lt;=10^6)) are given in the first line of the standard input, separated by single spaces. These denote, respectively: the number of contestants on a team, the number of problems, the time it takes a contestant to solve a problem, the duration of the contest, and the number of contestant-problem pairs given on the input. Each of the following k lines holds two integers a and b(1&lt;=a&lt;=n,1&lt;=b&lt;=m)), separated by a single space, denoting that the con