import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner koko = new Scanner(System.in); int w = koko.nextInt(); int d = koko.nextInt(); int rw = w; long rd = d; for(int i=0; i1){ int done = (int)Math.floor(rw/(rd*rd)); rw=rw-done; rd=rd-1; }else{ break; } } System.out.println(rw); } }