<|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  
```cpp
#include <bits/stdc++.h>

using namespace std;

template<typename T1, typename T2>
ostream& operator<<(ostream& out, const pair<T1, T2>& x) {
    return out << x.first << ' ' << x.second;
}

template<typename T1, typename T2>
istream& operator>>(istream& in, pair<T1, T2>& x) {
    return in >> x.first >> x.second;
}

template<typename T>
istream& operator>>(istream& in, vector<T>& a) {
    for(auto& x: a) {
        in >> x;
    }
    return in;
};

template<typename T>
ostream& operator<<(ostream& out, const vector<T>& a) {
    for(auto x: a) {
        out << x << ' ';
    }
    return out;
};

int64_t p, milk, c;
int64_t k, r, v;

void read() {
    cin >> p >> milk >> c;
    cin >> k >> r >> v;
}

void solve() {
    // Each patty needs k flour, r milk, v cabbage. The number of patties is
    // limited independently by each ingredient, so the answer is the minimum of
    // the integer divisions p / k, milk / r and c / v.

    int64_t answer = p / k;
    answer = min(answer, c / v);
    answer = min(answer, milk / r);
    cout << answer << '\n';
}

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

    int T = 1;
    // cin >> T;
    for(int test = 1; test <= T; test++) {
        read();
        // cout << "Case #" << test << ": ";
        solve();
    }

    return 0;
}
```

5. Python Implementation with Detailed Comments  
```python
import sys

def main():
    # Read six integers from standard input (may span multiple lines)
    # P, M, C: available resources
    # K, R, V: requirements per patty
    P, M, C, K, R, V = map(int, sys.stdin.read().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()
```
