WC '17 Contest 2 J2 - Breeding an Army
View as PDFWoburn Challenge 2017-18 Round 2 - Junior Division

The evil wizard Saruman is breeding himself an army of fearsome Uruk-hai
soldiers. Each Uruk-hai can be created out of  men, 
 orcs,
and 
 litres of mud 
.
Saruman has at his disposal  men, 
 orcs, and 
litres of mud 
.
What's the maximum number of Uruk-hai that Saruman can create without exceeding his resources?
Input Specification
The first line of input consists of three space-separated integers,
, 
, and 
.
The next line consists of three space-separated integers, ,
, and 
.
Output Specification
Output a single integer, the maximum number of Uruk-hai that can be created.
Sample Input
1 4 3
8 14 10
Sample Output
3
Sample Explanation
Creating  Uruk-hai requires 
 men, 
 orcs, and 
 litres of mud, which
doesn't exceed Saruman's resources. However, he would not be able to
create 
 Uruk-hai.
Comments