Oz's paintings
Practice
3.8 (434 votes)
Ad Hoc
Combinatorics
Easy
Ready
Mathematics
Approved
Problem
54% Success 8480 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code
Today Oz wants to make some money through his paintings. For painting, Oz has X white color pens, Y red color pens and Z green color pens. Their are 4 types of paintings he wants to make i.e.
- First kind of painting needs 3 white color pens.
- Second kind of painting needs 3 red color pens.
- Third kind of painting needs 3 green color pens.
- Fourth kind of painting needs 1 white, 1 red and 1 green color pen.
Oz wants to earn more money so he wants to make maximum number of paintings. Help Oz to find the maximum number of paintings he can make.
Input :
The first line contains the number of test cases T. Each test case consists of 3 integers X, Y and Z — the number of white, red and green color pens.
Output :
For each test case print the maximum number of paintings Oz can make.
Constraint :
1 ≤ T ≤ 10
0 ≤ X, Y, Z ≤ 109
Submissions
Please login to view your submissions
Similar Problems
Points:30
6 votes
Tags:
ApprovedMathMedium
Points:20
22 votes
Tags:
ApprovedEasyMathOpenSorting
Points:30
Tags:
Medium
Editorial