import java.io.PrintWriter; import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner scanner=new Scanner(System.in); PrintWriter out=new PrintWriter(System.out); int n=Integer.parseInt(scanner.next()); int k=Integer.parseInt(scanner.next()); String s=scanner.next(); int x=0, y=0; int i; for(i=0; i=k) { out.println(x); out.close(); scanner.close(); return; } } if(x<=y) { out.println(x); }else { int ans=x+(k-n)/n*(x-y); k%=n; if(k>0) { int y0=y; x=0; y=0; for(i=0; i=k) { ans+=Math.max(0, x-y0); break; } } } out.println(ans); } out.close(); scanner.close(); } }