Fn.java
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package basic;
import java.util.Scanner;
/**
*
* @author cteam043
*/
public class Fn {
public static void main
(String[] args
) {
Scanner in
= new Scanner
(System.
in); int points, lines, n1, n2;
int [] nodes = new int [10005];
while(in.hasNextInt()){
points = in.nextInt();
lines = in.nextInt();
for(int p = 0; p < nodes.length; p++)
nodes[p] = 0;
for(int i = 0; i < lines; i++){
n1 = in.nextInt();
n2 = in.nextInt();
nodes[n1]++;
nodes[n2]++;
}
for(int p = 0; p < nodes.length; p++){
if(nodes[p] >= 4){
return;
}
}
}
}
}