public static <E extends Comparable<? super E>> List<E> maximalSlidingWindow(List<E>list, int w) {
		Queue<E> window=new ArrayDeque<>();
		ListIterator<E>iter=list.listIterator();
		for (int i=0;i<w&&iter.hasNext();)window.offer(iter.next());
		List<E>rel=new ArrayList<>(); rel.add(Collections.max(window));
		while (iter.hasNext()) {
			window.poll(); window.offer(iter.next());
			rel.add(Collections.max(window));
		}
		return rel;
	}