import java.io.*; import java.util.Arrays; import java.util.StringTokenizer; public class Main{ static final InputStream in=System.in; static final PrintWriter out=new PrintWriter(System.out); public static boolean check(int now,int n,int d,int k){ if((2*now+k-1)*k/2>d||(2*n-k+1)*k/2