import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;
public class Test{
public static void main(String[] args){
HashSet
Scanner scanner = new Scanner(System.in);
//路长度
int length = scanner.nextInt();
//区间个数
int num = scanner.nextInt();
for (int i=0;i
int end = scanner.nextInt();
//区间集合
range.add(new T(start, end));
}
int count = 0;
for (int i=0;i
}
System.out.println("rest " + count + " trees");
}
//如果>=起点并且<=终点则在范围内
public static boolean in(int object, HashSet
for (T t:range){
if (object>=t.start && object<=t.end) return true;
}
return false;
}
}
//区间类,只有两个成员开始和结束
class T{
public int start, end;
public T(int start, int end){
this.start = start;
this.end = end;
}
}