import std; void main () { int A, B, C, D; readln.read(A, B, C, D); int ans = 0; foreach (i; 0..2000) { if (i * A <= C && i * B <= D) ans = i; } writeln(ans); } void read (T...) (string S, ref T args) { import std.conv : to; import std.array : split; auto buf = S.split; foreach (i, ref arg; args) { arg = buf[i].to!(typeof(arg)); } }