A Relation on Numbers

All submissions for this problem are available.
Ned is quite bored in class. As he is very interested in Mathematics, he decides to develop a new number system which he would name after himself. Unlike the other “traditional” number systems, his system does not have “lowlevel” relationships like successors, predecessors etc. Rather the system is modeled in such a way that it has entities represented by numbers which are related via very complex classes and a mathematical relation R.
The relation R is symmetric i.e. if a R b , then b R a but is not transitive.
He then asks his archrival Ted to solve a problem in this number system. The problem is to find a subset of a given set of N entities which satisfies the following property.
 For every element a in this subset, the number of distinct elements in the subset which are related to a with the relation R is atleast K.
Ted, being a phony, runs to you for help. Help him in finding such a subset.
Input
The first line of input contains three space separated integers, N, the number of distinct entities, M, the number of different class relations and K, the size of this subset. Each of the M lines that follow contains two integers a and b, meaning that a and b are related by relation R.
Output
For each test case, output a single line containing an integer S, the size of such a maximum subset. If such a subset is not possible, output 0.
Constraints
 1 ≤ N ≤ 10^5
 1 ≤ M ≤ min{n*(n1)/2, 5*10^5}
 1 ≤ K ≤ N
 0 ≤ a,b ≤ N1
Example
Input: 3 3 2 0 1 0 2 1 2 Output: 3
Author:  iopc_admin 
Tags  iopc_admin 
Date Added:  7032013 
Time Limit:  0.351351 sec 
Source Limit:  50000 Bytes 
Languages:  C, JAVA, GO 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions