using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace yukicoderTest { class Program { static void Main(string[] args) { string[] str = Console.ReadLine().Split(' ') ; int vegi = int.Parse(str[0]); int meat = int.Parse(str[1]); int bai = int.Parse(str[2]); int total = int.Parse(str[3]); int cnt = 0; while(vegi>=0&&meat>=bai&&total>=0) { vegi--; meat = meat - bai; total = (total - bai) - 1; cnt++; } Console.WriteLine(cnt); } } }