public static <T extends Comparable<T>> List<T> quickSelect(List<T> list, int k) {
		List<T> rel=new ArrayList<>();
		while(true) {
			int p=0+list.size()/2,l=1; T pivot=list.get(p);
			Collections.swap(list, 0, p);
			for (int i=1;i<list.size();++i) if (list.get(i).compareTo(pivot)<=0) Collections.swap(list, l++, i);
			Collections.swap(list, 0, l-1);
			if (l==k) {rel.addAll(list.subList(0, k)); break;}
			else if (l>k) list=list.subList(0, l-1);
			else {rel.addAll(list.subList(0, l));list=list.subList(l, list.size());k-=l;}
		}
		return rel;
	}