<|instruction|>
Solve the below problem. The solution should start with an abridged problem statement. Then key observations. Then full solution based on the observations. Then C++ and Python implementations with comments.

184. Patties
time limit per test: 0.25 sec.
memory limit per test: 4096 KB
input: standard input
output: standard output



Petya is well-known with his famous cabbage patties. Petya's birthday will come very soon, and he wants to invite as many guests as possible. But the boy wants everybody to try his specialty of the house. That's why he needs to know the number of the patties he can cook using the stocked ingredients. Petya has P grams of flour, M milliliters of milk and C grams of cabbage. He has plenty of other ingredients. Petya knows that he needs K grams of flour, R milliliters of milk and V grams of cabbage to cook one patty. Please, help Petya calculate the maximum number of patties he can cook.

Input
The input file contains integer numbers P, M, C, K, R and V, separated by spaces and/or line breaks (1 <= P, M, C, K, R, V <= 10000).

Output
Output the maximum number of patties Petya can cook.

Sample test(s)

Input
3000 1000 500
30 15 60

Output
8
Author:	Andrew V. Lazarev
Resource:	ACM International Collegiate Programming Contest 2003-2004
North-Eastern European Region, Southern Subregion
Date:	2003 October, 9

<|response|>
1. Abridged Problem Statement  
Given integers P, M, C (amounts of flour in grams, milk in milliliters, and cabbage in grams) and integers K, R, V (grams of flour, milliliters of milk, and grams of cabbage needed per patty), compute the maximum number of patties Petya can cook.  

2. Key Observations  
- Each patty consumes all three key resources.  
- The flour supply alone allows at most floor(P / K) patties.  
- The milk supply alone allows at most floor(M / R) patties.  
- The cabbage supply alone allows at most floor(C / V) patties.  
- Since you cannot exceed any of these three limits, the true maximum is the minimum of those three quotients.  

3. Full Solution Approach  
Step 1. Read the six integers P, M, C, K, R, V from input.  
Step 2. Compute how many patties each resource can support:  
    x1 = P // K  
    x2 = M // R  
    x3 = C // V  

Step 3. The answer is min(x1, x2, x3).  
Step 4. Print that minimum.  

This runs in constant time and uses only a few integer variables.  

4. C++ Implementation with Detailed Comments  
#include <iostream>  
using namespace std;  

int main() {  
    ios::sync_with_stdio(false);  
    cin.tie(nullptr);  

    // Read the available quantities of each ingredient  
    // P = flour (grams), M = milk (milliliters), C = cabbage (grams)  
    int P, M, C;  
    // K, R, V = requirement per patty of flour, milk, cabbage  
    int K, R, V;  
    cin >> P >> M >> C >> K >> R >> V;  

    // Compute how many patties each ingredient alone would allow  
    int maxByFlour = P / K;    // integer division floors automatically  
    int maxByMilk  = M / R;  
    int maxByCabb  = C / V;  

    // The limiting factor is the smallest of these three values  
    int result = maxByFlour;  
    if (maxByMilk < result) result = maxByMilk;  
    if (maxByCabb < result) result = maxByCabb;  

    // Output the final answer  
    cout << result << "\n";  
    return 0;  
}  

5. Python Implementation with Detailed Comments  
def main():  
    # Read six integers from standard input  
    # P, M, C: available resources  
    # K, R, V: requirements per patty  
    P, M, C, K, R, V = map(int, input().split())  

    # Compute the maximum patties each resource can support  
    max_by_flour = P // K    # floor division  
    max_by_milk  = M // R  
    max_by_cab   = C // V  

    # The answer is the minimum of the three  
    answer = min(max_by_flour, max_by_milk, max_by_cab)  

    # Print the result  
    print(answer)  

if __name__ == "__main__":  
    main()