P26952 [AtCoder] Bouquets
普及+
题目描述

Problem Description

Takahashi wants to make many bouquets consisting of $ A $ red flowers and $ B $ blue flowers.

When he has $ X $ red flowers and $ Y $ blue flowers, what is the maximum number of bouquets he can make?

Input Format

The input is given from the standard input in the following format:

$ A $ $ B $ $ X $ $ Y $

Output Format

Output the maximum number of bouquets that can be made.

Sample Input and Output

Sample Input #1

3 2 6 4

Sample Output #1

2

Sample Input #2

3 3 100 0

Sample Output #2

0

Sample Input #3

5 10 30 23

Sample Output #3

2

Notes/Hints

Constraints

  • $1 \leq A, B \leq 100$
  • $0 \leq X, Y \leq 100$
  • All inputs are integers
输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
3 2 6 4
样例输出
2