Fox Ciel has some flowers: r red flowers, g green flowers and b blue flowers. She wants…
- User
Fox Ciel has some flowers: r red flowers, g green flowers and b blue flowers. She wants to use these flowers to make several bouquets. There are 4 types of bouquets:
- To make a "red bouquet", it needs 3 red flowers.
- To make a "green bouquet", it needs 3 green flowers.
- To make a "blue bouquet", it needs 3 blue flowers.
- To make a "mixing bouquet", it needs 1 red, 1 green and 1 blue flower.
Help Fox Ciel to find the maximal number of bouquets she can make. Input
The first line contains three integers r, g and b (0 ≤ r, g, b ≤ 109) — the number of red, green and blue flowers.
Output
Print the maximal number of bouquets Fox Ciel can make.
Examples
Input
3 6 9
Output
6
Input
4 4 4
Output
4
Input
0 0 0
Output
0
Note
In test case 1, we can make 1 red bouquet, 2 green bouquets and 3 blue bouquets.
In test case 2, we can make 1 red, 1 green, 1 blue and 1 mixing bouquet.
Assistant
We need to maximize the number of bouquets given constraints.
We have four types: each uses 3 of a single color, or 1 of each.
We need to allocate flowers to maximize total bouquets.
Let r,g,b be the counts.
We can think of mixing bouquets as using one of each, while single-color bouquets use three of a single color.
Let x = number of mixing bouquets. Then we consume x red, x green, x blue.
After that, we have remaining: r' = r - x, g' = g - x, b' = b - x (but not negative, so x ≤ min(r,g,b)). Then we can make floor(r'/3) red bouquets, floor(g'/3) green, floor(b'/3) blue.
Total = x + floor(r'/3)+floor(g'/3)+floor(b'/3).
We need to maximize over integer x from 0 to min(r,g,b). Since r,g,b up to 1e9, we can't brute force all x. But we can reason about optimal x.
Observation: The mixing bouquet uses one of each, while single-color bouquets effectively "use" three of the same. However, sometimes it might be beneficial to use mixing bouquets to "balance" the colors if one color is abundant and the others scarce. Because single-color bouquets require three of one color; if we have a lot of red but little green/blue, we might not be able to use all red in red bouquets because we may run out of flowers in other colors? Actually red bouquets only use red, so they don't depend on other colors. So we can always use as many red bouquets as floor(r/3). But if we have many red but also some green/blue, we might consider converting some red from potential red bouquets to mixing bouquets if that allows using green/blue that would otherwise be wasted? However, green and blue can also be used in their own single-color bouquets. So it's about the tradeoff: A mixing bouquet uses (1,1,1) and yields 1 bouquet; if we instead used those flowers in single-color bouquets, we would need 3 red to get 1 bouquet, 3 green to get 1, 3 blue to get 1. So mixing bouquet uses 3 flowers to produce 1 bouquet, same as a single-color bouquet (which also uses 3 flowers to produce 1). However, mixing bouquet uses a combination, so the efficiency in terms of flowers per bouquet is the same (3 flowers per bouquet). Therefore, the only constraint is that we cannot use fractional bouquets; the optimal is to maximize total bouquets, which is essentially to use as many flowers as possible in groups of 3, but with the flexibility that mixing bouquets allow using one from each color as a group. Since all bouquets use exactly 3 flowers, the maximum number of bouquets is at most floor((r+g+b)/3). But also limited by the fact that mixing bouquet requires one of each color, but we can also use single-color bouquets. The theoretical max is floor(total_flowers/3). But can we always achieve that? Not necessarily, because if one color is extremely scarce, we might not be able to pair it with others? But we can always use the scarce color in mixing bouquets only if we have enough of the others? Actually consider if r=0, g=1, b=5. Total flowers=6 => floor(6/3)=2 bouquets possible? Can we make 2 bouquets? Options: mixing requires all three colors, so can't because red=0. So only green and blue bouquets: green bouquet requires 3 greens -> we have only 1, cannot. Blue bouquet requires 3 blues: we have 5 -> can make 1 blue bouquet (using 3). That's 1 bouquet total. Could we use remaining 2 blues? No, because need groups of 3. So max=1, less than floor(total/3)=2. So the maximum is limited because we cannot use leftover flowers of a color if not enough to form groups of 3 and we cannot combine them with other colors except via mixing bouquets (which need one of each). So we need to compute optimum.
Thus, we need to maximize x + floor((r-x)/3) + floor((g-x)/3) + floor((b-x)/3) subject to 0 ≤ x ≤ min(r,g,b). Because after using x mixing bouquets, we use remaining for single-color.
This is a classic problem: "Bouquets" from Codeforces 322B? Actually similar to "Ciel and Flowers" problem (CF 322B? I recall a problem "Ciel and Flowers" that is exactly this). The typical solution: try x = 0,1,2, maybe also min(r,g,b) and min(r,g,b)-1, min(r,g,b)-2 because the floor function changes only every 3. Since floor((r-x)/3) changes when x mod 3 changes, we can bound x to a small set around the candidate.
Specifically, note that the total function f(x) = x + floor((r-x)/3)+ floor((g-x)/3)+ floor((b-x)/3). The derivative (discrete) changes behavior. It's optimal to check x around the values where the remainders matter. Usually we try x = min(r,g,b) and also x = min(r,g,b)-1, x = min(r,g,b)-2, and also maybe x = 0,1,2. Because as x decreases by 3, the floor parts increase by 1 each? Let's analyze:
Let r = 3a_r + r0 where r0 in {0,1,2}. Similarly for g,b.
If we set x = k, then floor((r-k)/3) = floor((3a_r + r0 - k)/3). Write k = 3q + t, where t in {0,1,2}. Then floor = a_r - q + floor((r0 - t)/3). But floor((r0 - t)/3) is -1 if r0 < t? Actually r0-t can be negative, floor division: floor((negative)/3) = -1 if negative? Let's be careful: For integer division in C++ (floor division for positive numbers, but here we are dealing with nonnegative (r-x) so it's always >=0 if x ≤ r. So r-x >= 0, so it's standard integer division truncating toward zero? Actually floor division of positive numbers is just integer division, but (r-x) is nonnegative, so floor((r-x)/3) = (r-x)//3 (integer division truncating toward zero). Since it's nonnegative, we can just compute integer division.
So the function is not linear. However, we can argue that we only need to test x in {0,1,2} plus the values near the boundaries: because the contribution from each floor term depends on x mod 3 relative to the remainders. Typically, one can try all x from 0 to min(r,g,b) but that's too large. But we can note that for large values, the function f(x) is roughly x + (r+g+b - 3x)/3 = (r+g+b)/3, so it's constant for large x? Actually compute: x + (r+g+b - 3x)/3 = (r+g+b)/3. That's exact if we ignore floors. The floor introduces a deviation of at most 2 (since sum of floors vs actual division may differ by at most 2). So the optimal might be near x = min(r,g,b) or near 0, but we need to check a few values.
Specifically, from known solution for Codeforces problem 322B "Ciel and Flowers", the typical solution is: let ans = 0; for (int i = 0; i < 3; i++) if (r >= i && g>=i && b>=i) ans = max(ans, i + (r-i)/3 + (g-i)/3 + (b-i)/3); However, I recall that sometimes you need to check i=0,1,2 because the remainder matters. But there is a nuance: Actually in the CF problem, many solutions got hacked because they only did that, and they needed to also consider x = min(r,g,b) possibly? Let's recall: Problem "Ciel and Flowers" from Codeforces Round #190 (Div. 2), problem B? Or maybe problem 322B. I recall a solution: ans = max( (r/3)+(g/3)+(b/3) + min(r%3,g%3,b%3), but that's for some variant? Wait that is for the problem where you have three types of flowers and you can make either 1 of each or 3 of same? Actually that formula is for when you can make a bouquet of three flowers of same color OR one of each. There is known solution: ans = (r/3)+(g/3)+(b/3) + min(r%3, g%3, b%3). But is that always optimal? Let's test with r=0,g=1,b=5: r/3=0, g/3=0, b/3=1, sum=1; min(r%3,g%3,b%3)= min(0,1,2)=0, ans=1. That matches our earlier max=1. Another test: r=3,g=3,b=3: /3 each=1, min(0,0,0)=0 => ans=3? But we can make 4 bouquets: 3 mixing? Actually we can make 1 red, 1 green, 1 blue, and 1 mixing? Wait with 3 of each, we have total 9 flowers. The formula gives 3? That seems low. Actually with 3 of each, we could make: three mixing bouquets? That would use 3 red, 3 green, 3 blue = 3 bouquets? No mixing bouquet yields 1 per set of (1,1,1). To make 3 mixing bouquets, need 3 red,3 green,3 blue => total 9 flowers, yields 3 bouquets. But we can also do: 1 red bouquet (3 red), 1 green bouquet (3 green), 1 blue bouquet (3 blue) => 3 bouquets. So 3 bouquets total. But earlier I thought 4? Let's recalc: Actually the problem statement: 4 types: red (3 red), green (3 green), blue (3 blue), mixing (1 red,1 green,1 blue). With 3 red, 3 green, 3 blue, the maximum bouquets is 3, because each bouquet uses 3 flowers. If we try to mix, each mixing uses 3 flowers as well, so total bouquets = total flowers/3 = 3. So 3 is correct. My earlier test case 2 in the problem: Input: 4 4 4 Output: 4. Because with 4 each, total flowers=12, so maximum possible 4 bouquets. The formula (r/3)+(g/3)+(b/3) + min(r%3,g%3,b%3) would be: 4/3=1 each, sum=3; min(1,1,1)=1 => total 4. Yes. So that formula seems plausible.
But is it always optimal? Let's test more: r=5,g=5,b=0: total=10, floor(10/3)=3. Can we get 3? With 0 blue, mixing impossible. So only red and green bouquets: floor(5/3)=1 each => total 2 bouquets. Could we get 3? Maybe by not using some flowers? 2 red bouquets would need 6 red, not enough. So max=2. Formula: r/3=1, g/3=1, b/3=0, sum=2; min(5%3=2,5%3=2,0%3=0)=0 => ans=2. OK.
r=5,g=4,b=3: total=12 => max possible 4. Let's compute: r/3=1, g/3=1, b/3=1 => sum=3; remainders: r%3=2, g%3=1, b%3=0, min=0 => formula=3. But can we get 4? Maybe by using mixing: try x=1: then r=4,g=3,b=2, then floors: r/3=1,g/3=1,b/3=0 => total=1+1+1+0=3? Actually 1 mixing + 1 red + 1 green =3. x=2: r=3,g=2,b=1 => floors: r/3=1,g/3=0,b/3=0 => total=2+1=3. x=3: r=2,g=1,b=0 => floors: r/3=0,g/3=0,b/3=0 => total=3. So max=3. So formula works.
But there is a known counterexample? I recall some issues: In Codeforces 322B, the sample was 4 4 4 -> 4, and some edge cases like 0 0 0, 1 1 1 etc. However, there was a hack case: r=2, g=5, b=8? Let's test. r=2,g=5,b=8. total=15 => floor=5. Formula: r/3=0, g/3=1, b/3=2 => sum=3; remainders: r%3=2, g%3=2, b%3=2, min=2 => ans=5. So formula says 5. Can we achieve 5? We need to use 15 flowers in bouquets, each bouquet uses 3 flowers, so we must use all flowers. To achieve 5 bouquets, we must use all 15 flowers. But is it possible? Let's try: We have 2 red, 5 green, 8 blue. To use all, we must pair them. Options: mixing bouquets use one of each. Suppose we make x mixing. Then we need x <= min(2,5,8)=2. Then after mixing, we have red: 2-x, green:5-x, blue:8-x. Then we need to form single-color bouquets from leftovers, each uses multiples of 3. So we need each leftover to be divisible by 3? Not necessarily, but the sum of leftovers must be divisible by 3, but also each leftover must be able to be partitioned into groups of 3. For single-color bouquets, each color's leftover must be a multiple of 3, else we have leftover flowers of that color that cannot be used (they could be used in mixing? but we already used x mixing). However, could we have a scenario where we don't use all flowers but still get 5 bouquets? Since total flowers is 15, if we get 5 bouquets, we use exactly 15 flowers, so all must be used. So we need to find x such that (2-x) mod 3 == 0, (5-x) mod 3 == 0, (8-x) mod 3 == 0. That is, x mod 3 must be 2 mod 3? Let's compute: For red: (2-x) mod3=0 => x ≡ 2 mod3. For green: (5-x) mod3=0 => x ≡ 5 mod3 => x≡2 mod3. For blue: (8-x) mod3=0 => x ≡ 8 mod3 => x≡2 mod3. So x=2 works: x=2 mixing, then red 0, green 3, blue 6 => can make 1 green bouquet and 2 blue bouquets, total = 2+1+2=5. Indeed that works. So formula gives 5, which is correct.
Now consider r=1,g=3,b=5. Total=9 => max possible 3. Formula: r/3=0,g/3=1,b/3=1 sum=2; remainders: 1,0,2 min=0 => ans=2. But can we get 3? Let's see: We need to use all 9 flowers. Could we achieve 3 bouquets? Options: mixing x ≤1. Try x=1: then r=0,g=2,b=4 => leftover: red0, green2, blue4. Can't make single-color bouquets from green because 2 not multiple of 3, blue 4 not multiple, but maybe we could use another mixing? No, red=0 so cannot. So total =1 mixing + floor(0/3)+floor(2/3)+floor(4/3)=1+0+0+1=2. x=0: then floors: r/3=0,g/3=1,b/3=1 => total 2. So max=2. So formula works.
Now consider r=2,g=2,b=2: total=6 => max=2. Formula: r/3=0,g/3=0,b/3=0 sum=0; remainders:2,2,2 min=2 => ans=2. Indeed we can make 2 mixing bouquets? Actually need 1 each for mixing: with 2 each, we can make 2 mixing bouquets (use 2 red,2 green,2 blue) => 2 bouquets. Or we could make 0 mixing and 0 single? Actually can't make single because need 3 of a color. So 2 mixing is best. So formula works.
Now consider r=0,g=2,b=4: total=6 => max possible 2. Formula: r/3=0,g/3=0,b/3=1 sum=1; remainders:0,2,1 min=0 => ans=1. But can we get 2? Let's attempt: mixing impossible because red=0. So only green and blue bouquets: green can't make any (2<3), blue can make 1 (3 out of 4). That uses 3 blue, leaving 1 blue and 2 green unused => total 1 bouquet. Could we do something else? Maybe use a mixing? no. So max=1. So formula correct.
Now consider r=1,g=1,b=3: total=5 => floor(5/3)=1. Formula: r/3=0,g/3=0,b/3=1 sum=1; remainders:1,1,0 min=0 => ans=1. Achievable? mixing x<=1. Try x=1: then r=0,g=0,b=2 => floors:0,0,0 => total=1. So yes.
Now consider a tricky case: r=3,g=3,b=2. total=8 => floor=2. Formula: r/3=1,g/3=1,b/3=0 sum=2; remainders:0,0,2 min=0 => ans=2. Is it achievable? Let's test: If we make mixing: x ≤2. Try x=2: then r=1,g=1,b=0 -> floors:0,0,0 => total=2 (2 mixing). So yes. So 2 bouquets. Could we get 3? No, total flowers only 8, need 9 for 3. So ok.
Now consider r=2,g=4,b=6. total=12 => max possible 4. Formula: r/3=0,g/3=1,b/3=2 sum=3; remainders:2,1,0 min=0 => ans=3. But is it possible to get 4? Let's try: need to use all 12 flowers to get 4 bouquets. Let's check possibilities. We have 2 red, 4 green, 6 blue. Mixing x ≤2. Try x=2: then red0, green2, blue4 => floors:0,0,1 (blue 4 gives 1) => total=2+1=3. Try x=1: red1, green3, blue5 => floors:0,1,1 => total=1+2=3. Try x=0: red2,green4,blue6 => floors:0,1,2 => total=3. So max=3. So formula correct.
Now consider r=5,g=7,b=8. total=20 => floor=6. Formula: r/3=1,g/3=2,b/3=2 sum=5; remainders:2,1,2 min=1? Actually min(2,1,2)=1 => ans=6. So formula predicts 6. Can we achieve 6? Try to find x. Need 6 bouquets using 20 flowers? Actually 6 bouquets use 18 flowers, we might have 2 leftover. So we don't need to use all. Let's check: With x mixing, total = x + floor((5-x)/3)+ floor((7-x)/3)+ floor((8-x)/3). Compute for x from 0 to min=5. x=0: 0 + floor(5/3)=1 + floor(7/3)=2 + floor(8/3)=2 => total=5. x=1: 1 + floor(4/3)=1 + floor(6/3)=2 + floor(7/3)=2 => total=6? 1+1+2+2=6. So x=1 yields 6. Yes. So formula works.
Now consider a case where the naive formula might fail? I recall reading that the solution ans = (r/3)+(g/3)+(b/3) + min(r%3,g%3,b%3) is correct for many cases but fails for cases like r=0,g=0,b=2? That gives ans = 0 + 0 + 0 + min(0,0,2)=0, correct. But is there any case where it's not optimal? I think there is a known counterexample: r=2, g=3, b=4? Let's test. r=2,g=3,b=4 total=9 => floor=3. Formula: r/3=0,g/3=1,b/3=1 sum=2; remainders:2,0,1 min=0 => ans=2. But can we get 3? Try to achieve 3 bouquets. Options: x mixing <=2. x=2: r=0,g=1,b=2 => floors:0,0,0 => total=2. x=1: r=1,g=2,b=3 => floors:0,0,1 => total=1+1=2. x=0: r=2,g=3,b=4 => floors:0,1,1 => total=2. So max=2. So formula ok.
Another case: r=1,g=4,b=7? total=12 => floor=4. Formula: r/3=0,g/3=1,b/3=2 sum=3; remainders:1,1,1 min=1 => ans=4. Check: x=1: r=0,g=3,b=6 => floors:0,1,2 => total=1+3=4. Works.
What about r=0,g=3,b=6? total=9 => floor=3. Formula: r/3=0,g/3=1,b/3=2 sum=3; remainders:0,0,0 min=0 => ans=3. Works.
Now maybe a tricky case where min(r%3,g%3,b%3) is not optimal because we might want to reduce the mixing count to allow more single-color bouquets? For instance, if one color has a huge remainder, and the other two have small remainders, maybe it's better to not use all possible mixings from the min remainder? Actually the formula adds min(r%3,g%3,b%3) mixing bouquets after taking as many triple-color bouquets as possible. That seems greedy: first take as many single-color bouquets as possible (by using floor division), then from the remainders, take mixings equal to the minimum remainder. But is that always optimal? Let's think: Could there be a case where taking fewer mixing bouquets than min(remainders) leads to more total because taking a mixing bouquet consumes one from each remainder, but also reduces the count of that color for possible single-color bouquets? However, we already took all possible full triples from each color? The approach: we first compute a = r/3, b = g/3, c = b/3. Then we have remainders r%3, g%3, b%3. The idea is that we can either use the remainders to form mixing bouquets, but each mixing bouquet uses one from each remainder. The maximum number of mixing bouquets from remainders is min(r%3,g%3,b%3). However, could it be beneficial to break one of the full triples (i.e., reduce a by 1 to free up 3 flowers of a color) to increase mixings? For example, if one color has many flowers and the others have few, perhaps converting a triple bouquet into three mixing bouquets? Actually, one triple bouquet uses 3 flowers of one color. If we break it, we get 3 flowers of that color that could be used in mixings with the other colors. But mixings require one from each color. So we might be able to create additional bouquets by "reassigning" some flowers from a color that is abundant to combine with scarce colors to form mixings, potentially increasing total count.
Consider r=6,g=4,b=2. Total=12 => floor=4. The greedy: r/3=2, g/3=1, b/3=0 sum=3; remainders: 0,1,2 min=0 => ans=3. But can we get 4 bouquets? Let's try to find manually. We need to produce 4 bouquets using 12 flowers. Options:
- If we make mixing bouquets: x ≤ min(6,4,2)=2. x=2: then r=4,g=2,b=0 => floors: r/3=1 (since 4), g/3=0, b/3=0 => total=2+1=3. x=1: r=5,g=3,b=1 => floors: r/3=1 (5->1), g/3=1 (3->1), b/3=0 => total=1+2=3. x=0: r=6,g=4,b=2 => floors: r/3=2, g/3=1, b/3=0 => total=3. So maximum =3. Could we do something else like using mixing plus breaking a triple? Suppose we don't use all flowers? But total 12, 4 bouquets use 12, so we must use all. Could we allocate differently: e.g., 1 red bouquet (3 red), 1 green bouquet (3 green), and 2 mixing bouquets (2 red,2 green,2 blue)? That uses red:3+2=5, green:3+2=5, blue:2=2. That's 5+5+2=12, yields 1+1+2=4 bouquets. But we have 6 red,4 green,2 blue. This allocation uses 5 red (leaving 1 red), 5 green (exceeds 4? Actually we need 5 green but we only have 4 green). So not feasible. Another: 0 red bouquet, 0 green bouquet, 4 mixing? need 4 red,4 green,4 blue, but we have only 2 blue, so impossible. What about: 2 red bouquets (6 red), 0 green, 0 mixing? that's 2 bouquets only. Not good. Maybe: 1 mixing (1,1,1) and then from remaining: red 5, green 3, blue 1. Could make 1 red (3 red) leaving red2, green0? Actually after mixing: red5, green3, blue1. Then make 1 green bouquet uses 3 green, leaving red5, green0, blue1. Then we have red5, blue1 -> can't form any bouquet. Total=2. So not 4. Thus 3 seems max.
Now consider r=5,g=5,b=2: total=12, floor=4. Greedy: r/3=1,g/3=1,b/3=0 sum=2; remainders:2,2,2? Actually 5%3=2,5%3=2,2%3=2, min=2 => ans=4. Check: x=2 mixing: then r=3,g=3,b=0 => floors: r/3=1,g/3=1 => total=2+2=4. So works.
Now consider r=4,g=4,b=1: total=9, floor=3. Greedy: r/3=1,g/3=1,b/3=0 sum=2; remainders:1,1,1 min=1 => ans=3. Check: x=1 mixing: then r=3,g=3,b=0 => floors:1,1,0 => total=1+2=3. Yes.
Now consider r=4,g=5,b=2: total=11, floor=3. Greedy: r/3=1,g/3=1,b/3=0 sum=2; remainders:1,2,2 min=1 => ans=3. Check: x=1 mixing: r=3,g=4,b=1 => floors:1,1,0 => total=1+2=3. Or maybe x=2? min=2? But b=2, so x=2 possible: r=2,g=3,b=0 => floors:0,1,0 => total=2+1=3. So 3.
Now consider r=6,g=3,b=3: total=12, floor=4. Greedy: r/3=2,g/3=1,b/3=1 sum=4; remainders:0,0,0 min=0 => ans=4. Indeed we can make 2 red, 1 green, 1 blue =4 bouquets. Could we get 5? No, total flowers 12, 5 would need 15. So ok.
Now consider a potential counterexample where it's better to not take all possible mixings from remainders because you could convert one triple into 3 mixings? That seems unlikely because triple gives 1 bouquet using 3 flowers of one color. Converting that triple into mixings would require you to have additional flowers of the other two colors to pair with the freed flowers. But if you free 3 flowers of a color, you need at least 3 flowers of each of the other two colors to make 3 mixings (since each mixing uses 1 from each). That would increase the total number of bouquets: originally you had 1 bouquet from the triple. After conversion, you could have up to 3 mixings (if you have enough other colors). However, each mixing also uses one from each of the other colors, so you need extra flowers. So the net gain would be 2 additional bouquets if you can supply the other colors. But you might also have to reduce other triples? This is reminiscent of the "Ciel and Flowers" problem where the known solution includes checking x=0,1,2 after taking min(r,g,b) but also check something like min(r,g,b) maybe? Actually I recall that the simple formula sometimes fails for cases like r=0,g=0,b=0? that's trivial. Another known tricky case: r=2,g=2,b=2? works. But I think there is a counterexample: r=3,g=3,b=2? we did, gives 2? Actually r=3,g=3,b=2 greedy: r/3=1,g/3=1,b/3=0 sum=2; remainders:0,0,2 min=0 => ans=2. But we found earlier maximum 2? Wait earlier we computed r=3,g=3,b=2, we got 2? Let's recompute: r=3,g=3,b=2. Options: x mixing max 2? Actually min=2, but if x=2: then r=1,g=1,b=0 => floors: 0,0,0 => total=2. x=1: r=2,g=2,b=1 => floors:0,0,0 => total=1. x=0: r/3=1,g/3=1 => total=2. So max=2. So okay.
What about r=4,g=4,b=4? greedy gives 4, correct.
But there is a known issue: If one of the remainders is 0, min=0, but maybe we could still make some mixing by breaking a full triple from a color with large remainder? For example, r=5,g=5,b=0? That's 0,0,? Actually b=0 so mixing impossible. So no.
Consider r=8,g=8,b=6? total=22 floor=7. Greedy: r/3=2 (since 8/3=2 floor), g/3=2, b/3=2? Actually 6/3=2, so sum=6; remainders: 2,2,0 min=0 => ans=6. But can we get 7? Possibly by using mixings? Let's test. We have 8,8,6. Total 22, 7 bouquets would use 21 flowers, leaving 1. So we might achieve 7. Let's see if we can get 7. Need to use 21 flowers. Options: try x mixing. Compute f(x) = x + floor((8-x)/3)+ floor((8-x)/3)+ floor((6-x)/3) for x ≤6. Compute: x=0: 0+2+2+2=6 x=1: 1+ floor(7/3)=2 + floor(7/3)=2 + floor(5/3)=1 => 1+2+2+1=6 x=2: 2+ floor(6/3)=2 +2 + floor(4/3)=1 => 2+2+2+1=7? Wait careful: For x=2: r'=6 => floor=2; g'=6 =>2; b'=4 =>1; total=2+2+2+1=7. Yes! So f(2)=7. But greedy gave 6. Why? Because greedy used only the remainders: r%3=2, g%3=2, b%3=0, min=0, so no mixing, total=6. But we found better by using 2 mixings, even though b had remainder 0, we reduced b from 6 to 4, which still allowed floor(4/3)=1 blue bouquet, and the red and green each dropped from 8 to 6, still 2 each. So net gain: we used 2 mixings (+2) while we lost 0 from red and green (since floor division unchanged because 8->6 both still give 2), but lost one from blue (floor(6/3)=2 to floor(4/3)=1, so -1). Net: +2-1=+1 compared to x=0. So it's beneficial. So the simple formula (sum of floors + min remainder) fails for this case. Indeed r=8,g=8,b=6 yields answer 7, not 6. Let's verify: Input: 8 8 6. According to our manual test, x=2 gives 7 bouquets: 2 mixing, 2 red, 2 green, 1 blue = total 7. Check usage: 2 mixing uses 2 red,2 green,2 blue. Then we have left: red=6, green=6, blue=4. Make 2 red bouquets (uses 6 red), 2 green bouquets (6 green), 1 blue bouquet (3 blue). That's total 2+2+2+1=7 bouquets. Flowers used: 2+2+2 +6+6+3 = 21? Let's sum: mixing: 2 red,2 green,2 blue; red bouquets: 6 red; green bouquets: 6 green; blue bouquet: 3 blue. Total red=8, green=8, blue=5? Wait blue: mixing 2 + blue bouquet 3 = 5, but we have b=6, so leftover 1 blue. So we use 5 blue, not all. That's fine; we only need to maximize bouquets. So total bouquets 7, uses 21 flowers, leaving 1 blue. So answer 7. The greedy formula gave 6. So it's a counterexample.
Thus the simple formula is insufficient. That's why the problem expects checking x from 0 to some small number (like 0..2) or maybe also checking near min(r,g,b). The typical solution for this Codeforces problem (322B) is to try x = 0,1,2 and also maybe x = min(r,g,b), min(r,g,b)-1, min(r,g,b)-2? Actually I recall the editorial: Because the answer only depends on the residues modulo 3, we can try to use 0, 1, or 2 mixing bouquets from the "remainder" part, but also we can consider using more than the min remainders by "breaking" some full triples. The typical approach is: Since each mixing bouquet uses one of each, we can think of using x mixing bouquets. The function f(x) is piecewise linear with slope changes. The optimum is near x = min(r,g,b) or near x values that make the remainders after subtraction small. Since the floor function decreases by 1 every time x passes a multiple of 3 for each color, the total decrease in the sum of floors per increment of x is roughly 1 for each color when x crosses a multiple of 3, but the mixing adds 1. So net effect: f(x+1)-f(x) = 1 - ( indicator(r-x >= 1? actually floor((r-x)/3) decreases by 1 when (r-x) mod 3 == 0? Let's compute difference: floor((r-(x+1))/3) - floor((r-x)/3) = -1 if (r-x) mod 3 == 0? More precisely, floor((a-1)/3) - floor(a/3) = -1 if a%3==0 else 0. So the decrease happens when the remaining after x is a multiple of 3. So the net gain of increasing x by 1 is 1 minus the number of colors for which (r-x) mod 3 == 0? Actually careful: f(x) = x + Σ floor((c_i - x)/3). Then f(x+1) - f(x) = 1 + Σ [ floor((c_i - x - 1)/3) - floor((c_i - x)/3) ]. The term in sum is -1 if (c_i - x) % 3 == 0, else 0. So the difference is 1 - ( number of i such that (c_i - x) % 3 == 0 ). This difference can be 1, 0, -1, -2 (since at most 3 colors). So f(x) is not monotonic. The optimum may be at points where the difference changes sign. Since the condition depends on (c_i - x) mod 3, the pattern repeats every 3 in x. So the function f(x) can be examined by considering x modulo 3. In particular, the optimal x can be found among a few candidates near the boundaries: 0, 1, 2, and also near the maximum possible x (min(r,g,b)) and perhaps a few steps down. Because as x increases, the sum of floors decreases by about x/3 each, but we add x. So the net trend is roughly constant: f(x) ≈ (r+g+b)/3. But due to floor effects, the maximum may be at either low x or high x. Typically, we can try x from 0 to min(2, min(r,g,b)) and also try x from min(r,g,b) down to min(r,g,b)-2 (ensuring non-negative). That covers the cases where the optimum occurs at the extremes due to the periodic nature. The editorial for Codeforces 322B suggests exactly that: try i=0..2, then set ans = max over i=0..2 of ( (r-i)/3 + (g-i)/3 + (b-i)/3 + i ) provided that i ≤ min(r,g,b). But this only tries i up to 2. Does that work for r=8,g=8,b=6? Let's test: i=0: (8/3=2)+(8/3=2)+(6/3=2)=6 => +0 =>6. i=1: ensure min≥1? yes. (7/3=2)+(7/3=2)+(5/3=1)=5 => +1 =>6. i=2: (6/3=2)+(6/3=2)+(4/3=1)=5 => +2 =>7. i=3: not tried because only up to 2. So max=7. So trying i=0,1,2 works for this case. But is it always sufficient to try only 0,1,2? Let's test another potential counterexample: r=9,g=9,b=0? i=0: (9/3=3)+(9/3=3)+(0)=6, i=1: (8/3=2)+(8/3=2)+(-? b= -1? but need b>=1 for i=1? Actually i must be ≤ min(r,g,b)=0, so i=1 not allowed. So only i=0 ->6. Is that optimal? We can only make red and green bouquets: floor(9/3)=3 each total 6. Mixings impossible because b=0. So 6 is correct.
Consider r=10,g=10,b=10? i=0: 3+3+3=9; i=1: (9/3=3)+(9/3=3)+(9/3=3)=9 +1=10? Wait careful: i=1: (10-1)/3=9/3=3 each, sum=9, +1=10. i=2: (8/3=2)+(8/3=2)+(8/3=2)=6, +2=8. So max=10. Is that correct? With 10 each, can we make 10 bouquets? Total flowers=30, max possible 10. Could we achieve 10? For example, use 10 mixing bouquets? That would require 10 of each, which we have. So yes, 10 mixing bouquets yields 10. So answer 10. So i=1 gives 10. Indeed min(r,g,b)=10, but we only tried up to 2, yet we got 10 because i=1 gave that. So it works.
But what about a case where the optimal x is larger than 2? For instance, if we need to subtract a large number to align remainders? Let's see if i=0..2 always covers the optimum. Since f(x) depends on x mod 3, and f(x) can be expressed as: let x = 3k + t, where t in {0,1,2}. Then: floor((c - x)/3) = floor((c - t)/3) - k, provided c - t >= 0? Actually (c - (3k+t)) = (c - t) - 3k. Then floor((c - t - 3k)/3) = floor((c - t)/3 - k) = floor((c - t)/3) - k, since k integer. So we have: f(x) = (3k+t) + Σ_i ( floor((c_i - t)/3) - k ) = t + Σ_i floor((c_i - t)/3) + (3k - 3k) = t + Σ_i floor((c_i - t)/3). So f(x) = t + Σ floor((c_i - t)/3) provided that x ≤ min(c_i) (since we need c_i - t ≥ 0 for floor to be defined? Actually we need c_i - x >= 0, but if x = 3k+t, then c_i - x = c_i - t - 3k. This is non-negative if and only if c_i >= t + 3k. So for a given t, the maximum k we can take is floor((c_i - t)/3) for each i? Actually the condition is k ≤ floor((c_i - t)/3) for each i. So the maximum possible k is min_i floor((c_i - t)/3). Then for that t, the f(x) becomes independent of k? Wait from the expression we derived, f(x) = t + Σ floor((c_i - t)/3) - (???) Let's derive carefully:
Let x = 3k + t, with 0 ≤ t ≤ 2. Then:
f(x) = x + Σ floor((c_i - x)/3) = 3k + t + Σ floor((c_i - 3k - t)/3).
Now, floor((c_i - 3k - t)/3) = floor((c_i - t)/3 - k) = floor((c_i - t)/3) - k, because floor(a - k) = floor(a) - k for integer k, provided a is not negative? Actually a = (c_i - t)/3. But (c_i - t) might not be divisible by 3, but floor(a - k) = floor(a) - k because k is integer and a may be fractional. Indeed floor(a - k) = floor(a) - k, since subtracting an integer shifts the floor. So we have:
floor((c_i - 3k - t)/3) = floor((c_i - t)/3) - k.
Thus:
f(x) = 3k + t + Σ [ floor((c_i - t)/3) - k ] = 3k + t + Σ floor((c_i - t)/3) - 3k = t + Σ floor((c_i - t)/3).
So interestingly, f(x) does not depend on k! That suggests that for a given residue t (0,1,2), the value of f(x) is constant regardless of how many multiples of 3 we add, as long as x = 3k + t is feasible (i.e., x ≤ min(c_i)). Therefore, the maximum over all feasible x is simply the maximum over t=0,1,2 (with the condition that there exists some k such that 3k+t ≤ min(c_i)). That condition is equivalent to t ≤ min(c_i) (since we can take k=0 if t ≤ min(c_i); if t > min(c_i), then we cannot have any x with that residue because even k=0 would require t ≤ min(c_i). But could we have k negative? No, x must be nonnegative integer). So we need t such that t ≤ min(c_i). However, even if t > min(c_i), we could potentially have k negative? No, k must be ≥0, because x = 3k + t, t ∈ {0,1,2}, k ≥0 integer. So the smallest x with given t is t. So we require t ≤ min(c_i). That's the condition for feasibility of at least k=0. But what about larger k? If t ≤ min(c_i), we can take k=0, so that x is feasible. So the condition is simply t ≤ min(r,g,b). So f(x) for any feasible x with that residue t is constant, equal to t + Σ floor((c_i - t)/3). So the maximum over all x is simply the maximum over t=0,1,2 such that t ≤ min(r,g,b) of that expression. So we only need to try t=0,1,2! That is a very neat observation. But wait, is that always true? Let's double-check the derivation.
We assumed that floor((c_i - t)/3 - k) = floor((c_i - t)/3) - k. This holds for any real number a and integer k: floor(a - k) = floor(a) - k. Yes, because subtracting an integer shifts the floor down by exactly that integer. So it's valid. However, we must also ensure that (c_i - t) may be negative? But if t ≤ c_i, then (c_i - t) ≥ 0, so (c_i - t)/3 is nonnegative, and floor is defined. But what if we consider k such that c_i - 3k - t becomes negative? The expression floor((c_i - 3k - t)/3) is still defined, but we used the identity floor(a - k) = floor(a) - k, which holds for any real a, even if a is negative? Actually floor(a - k) = floor(a) - k holds for any real a and integer k. Because floor(a - k) = floor(a) - k. Yes, that's a standard property: floor(x + n) = floor(x) + n for integer n. So it holds even if a is negative. However, we need to be careful: In our expression, a = (c_i - t)/3. If c_i - t is negative, then a is negative. floor(a - k) = floor(a) - k still holds? Let's test: a = -1.2, k=1, then a - k = -2.2, floor = -3. floor(a) = -2, floor(a)-k = -3. Yes, works. So identity holds for any real a and integer k. But we also have the requirement that the original expression floor((c_i - x)/3) must be computed for nonnegative arguments? Actually, if c_i - x is negative, then floor of a negative number is negative, but in our problem we only consider x ≤ c_i, because we cannot consume more flowers than we have. So we must have x ≤ c_i for each i. That is the feasibility condition: x ≤ min(r,g,b). So we only consider x up to that. In our representation x = 3k + t, with 0 ≤ t ≤ 2, and we need 3k + t ≤ min(c_i). For a given t, the maximum k is floor((min(c_i) - t)/3). But the value f(x) is independent of k, as we derived, provided we compute floor((c_i - x)/3) correctly. Let's verify with an example where k>0. For r=8,g=8,b=6, take t=2, then f(2) we computed as 7. According to formula: t=2, Σ floor((c_i - 2)/3) = floor(6/3)=2 + floor(6/3)=2 + floor(4/3)=1 => total = 2+2+1=5, plus t=2 =>7. For x=5 (which is 31+2), check: x=5 ≤ min=6? Actually min=6, so x=5 is feasible. Then compute f(5): x=5, r'=3, g'=3, b'=1 => floors:1,1,0 => total=5+2=7? Wait 5 + (1+1+0)=7. So indeed f(5)=7. For x=8 (32+2=8) but 8 > min=6, not feasible. So the value is same for any feasible x with same t. So indeed the function f(x) is constant on each residue class modulo 3, as long as x is within the feasible range (i.e., up to min). Therefore the maximum over all feasible x is simply max over t=0,1,2 where t ≤ min(r,g,b) of t + Σ floor((c_i - t)/3). That's it! So we only need to try t = 0, 1, 2, provided t ≤ min(r,g,b). That yields the answer.
But wait, is there any catch? The derivation seems solid. Let's test with another case: r=1,g=1,b=1. min=1. t=0: f=0 + floor(1/3)+floor(1/3)+floor(1/3)=0. t=1: 1 + floor(0/3)*3 =1+0=1. So max=1, correct.
r=2,2,2: min=2. t=0: 0+0+0+0? Actually floor(2/3)=0 each, sum=0 =>0. t=1: 1+ floor(1/3)*3=1+0=1. t=2: 2+ floor(0/3)*3=2+0=2. So max=2, correct.
r=3,3,3: t=0: 0+1+1+1=3; t=1:1+ floor(2/3)*3=1+0=1; t=2:2+ floor(1/3)*3=2+0=2. So max=3, correct.
r=4,4,4: t=0: 0+1+1+1=3; t=1:1+ floor(3/3)*3=1+3=4; t=2:2+ floor(2/3)*3=2+0=2. So max=4, correct.
r=8,8,6: min=6. t=0: 0+2+2+2=6; t=1:1+ floor(7/3)+floor(7/3)+floor(5/3)=1+2+2+1=6; t=2:2+ floor(6/3)+floor(6/3)+floor(4/3)=2+2+2+1=7; So max=7.
Thus, the answer is max over t=0,1,2 (with t ≤ min(r,g,b)) of t + floor((r-t)/3) + floor((g-t)/3) + floor((b-t)/3).
However, there is a nuance: If t > min(r,g,b), then that x is not feasible because we can't have x = t (since that would exceed some color). But could we have x with that residue class but with k>0 that is feasible? For example, suppose min(r,g,b)=1, so we cannot have x=2 (since 2>1). Could we have x=5? That would be 3*1+2=5, but 5 >1, not feasible. So indeed the only feasible residues are those where the smallest x with that residue (i.e., t) is ≤ min. So we only need to consider t=0,1,2 as long as t ≤ min. So the solution is straightforward.
But wait: Are there any cases where a larger x with the same residue but larger k is feasible while t is not? For instance, min=2, t=2 is feasible (x=2). t=5? That's residue 2 with k=1, but 5 > min, so not feasible. So if t is not feasible (i.e., t > min), then any x with that residue will be at least t, which is > min, so not feasible. So indeed only residues with t ≤ min are possible.
Thus the solution is simply: ans = max_{t=0,1,2, t ≤ min(r,g,b)} ( t + (r-t)//3 + (g-t)//3 + (b-t)//3 ). But is it always correct? Let's test some edge cases: r=0,g=0,b=0 => min=0, only t=0: 0+0+0+0=0. Good.
r=0,g=0,b=1: min=0, only t=0: 0+0+0+ floor(1/3)=0 => ans=0. Actually we can't make any bouquet because need at least 3 of a single color or 1 each. b=1 cannot form blue bouquet (needs 3), and mixing requires red/green. So 0 is correct.
r=0,g=1,b=2: min=0, t=0: 0+0+0+0? floor(0/3)=0, floor(1/3)=0, floor(2/3)=0 => 0. Could we make 1 mixing? No, because red=0. Could we make 1 blue? need 3 blues. So 0 correct.
r=0,g=2,b=4: t=0: 0+0+0+1=1? floor(4/3)=1 => total=1. But earlier we computed max=1. So ok.
r=1,g=2,b=3: min=1. t=0: 0+0+0+1=1; t=1: 1 + floor(0/3)+floor(1/3)+floor(2/3)=1+0+0+0=1. So ans=1. Can we do better? Try x=0: 0+0+0+1=1; x=1: 1 mixing + 0+0+0=1. So max=1. Could we make 2? Perhaps 1 mixing (1,1,1) uses (1,2,3)-> leftover (0,1,2) can't make any; total=1. Or 0 mixing, then we have 1 red,2 green,3 blue: can make 1 blue bouquet =>1. So correct.
Now consider r=2,g=3,b=5: min=2. t=0: 0+0+1+1=2; t=1:1+ floor(1/3)+floor(2/3)+floor(4/3)=1+0+0+1=2; t=2:2+ floor(0/3)+floor(1/3)+floor(3/3)=2+0+0+1=3. So ans=3. Check: Can we make 3? x=2 mixing: then left (0,1,3) -> 1 blue => total 3. Works.
r=1,g=4,b=7: min=1. t=0: 0+0+1+2=3; t=1:1+ floor(0/3)+floor(3/3)+floor(6/3)=1+0+1+2=4; ans=4. Yes we had earlier.
Now consider r=9,g=9,b=9: t=0: 3+3+3=9; t=1: 1+ floor(8/3)*3=1+2+2+2=7? Actually floor(8/3)=2 each, sum=6, plus1=7; t=2:2+ floor(7/3)=2 each? floor(7/3)=2 each sum=6, plus2=8. So max=9. So t=0 best.
But is there any case where t=2 is best? Already we saw 8,8,6 gave t=2 best. Also r=5,5,5: t=0: 5? floor(5/3)=1 each sum=3, t=0 =>3; t=1: 1+ floor(4/3)=1 each? floor(4/3)=1 each sum=3, plus1=4; t=2:2+ floor(3/3)=1 each sum=3, plus2=5. So max=5. Indeed with 5 each, we can make 5 mixing bouquets? Actually 5 each can make 5 mixing bouquets: uses 5 red,5 green,5 blue = 5 bouquets. So answer 5.
Now consider r=7,7,7: t=0: floor(7/3)=2 each, sum=6; t=1: 1+ floor(6/3)=2 each sum=6, plus1=7; t=2:2+ floor(5/3)=1 each sum=3, plus2=5. So max=7. Indeed 7 mixing bouquets? But 7 mixing would need 7 each, so yes 7. So t=1 gives 7? Wait t=1 gives 1 mixing plus floor(6/3)=2 each from singles => total 1+2+2+2=7. That's also valid: 1 mixing and 2 red,2 green,2 blue = 7. So answer 7.
Now consider r=10,10,10: t=0: floor(10/3)=3 each sum=9; t=1: 1+ floor(9/3)=3 each sum=9, plus1=10; t=2:2+ floor(8/3)=2 each sum=6, plus2=8. So max=10.
Now consider r=11,11,11: t=0: 3 each? floor(11/3)=3 each sum=9; t=1:1+ floor(10/3)=3 each sum=9, plus1=10; t=2:2+ floor(9/3)=3 each sum=9, plus2=11? Wait floor(9/3)=3 each sum=9, +2=11. So t=2 yields 11. Indeed 11 mixing bouquets? requires 11 each, yes. So t=2 best. So pattern: For numbers that are multiples of 3, t=0 gives max; for numbers ≡1 mod 3, t=1 gives max; for numbers ≡2 mod 3, t=2 gives max. That matches the observation that for equal numbers, answer = r + g + b / 3? Actually total = 3n, answer = n if n%3==0? For r=g=b=n, answer = n? Let's compute: If n=3, answer=3; n=4, answer=4; n=5, answer=5; n=6, answer=6? Wait n=6 each: t=0: floor(6/3)=2 each sum=6; t=1:1+ floor(5/3)=1 each sum=3, plus1=4; t=2:2+ floor(4/3)=1 each sum=3, plus2=5; so t=0 yields 6. So for n=6 (multiple of 3) answer=6. Indeed 6 mixing bouquets uses all. So answer = n when n%3==0? For n=3, answer=3; n=6, answer=6; yes. For n=4 (1 mod 3), answer=4; n=7 (1 mod 3) answer=7? Actually 7 gave 7, yes. For n=5 (2 mod 3), answer=5; n=8 (2 mod 3) each? Let's test n=8: t=0: floor(8/3)=2 each sum=6; t=1:1+ floor(7/3)=2 each sum=6, plus1=7; t=2:2+ floor(6/3)=2 each sum=6, plus2=8? Wait floor(6/3)=2 each, sum=6, +2=8. So answer=8. So indeed answer = n for n each, for all n. That makes sense because we can just make n mixing bouquets. So the formula t = n mod 3? Actually if n each, we can always make n mixing bouquets, so answer = n. And our max over t gives exactly that: for n mod 3 = 0, t=0 gives n; for n mod 3 = 1, t=1 gives n; for n mod 3 = 2, t=2 gives n. Good.
Now, is there any scenario where we need to consider t > 2 because min(r,g,b) is small? But t is the residue modulo 3. Since residues are only 0,1,2, that's exhaustive. The derivation shows that f(x) depends only on x mod 3, so the maximum over all x is the maximum over the three possible residues that are feasible (i.e., t ≤ min(r,g,b)). So we only need to check t=0,1,2, provided t ≤ min(r,g,b). That is it. So the answer is simple.
But wait, we must ensure that for a given residue t, the expression t + Σ floor((c_i - t)/3) is achievable with some x = t + 3k ≤ min(c_i). If t ≤ min(c_i), then x=t is feasible. So yes. So the answer is just the max of these three numbers.
Thus, the solution is: read r,g,b. Let m = min(r,g,b). Compute ans = 0. For t = 0 to min(2, m): compute cur = t + (r-t)//3 + (g-t)//3 + (b-t)//3; ans = max(ans, cur). Print ans.
But is that always correct? Let's test more random values, especially where the colors differ significantly.
Example: r=100, g=0, b=0. m=0, only t=0: ans = 0 + floor(100/3)=33 +0+0=33. That's correct (33 red bouquets). No mixing possible because others zero.
r=100, g=1, b=1. m=1. t=0: 0 + floor(100/3)=33 + 0 + 0 =33. t=1: 1 + floor(99/3)=33 + floor(0/3)=0 + floor(0/3)=0 => 34. So ans=34. Is that possible? Use 1 mixing (1,1,1) uses 1 red,1 green,1 blue. Then remaining red=99, green=0, blue=0. Then make 33 red bouquets from 99 red => total 34. Yes.
r=100, g=2, b=2. m=2. t=0: 0+33+0+0=33; t=1: 1+ floor(99/3)=33 + floor(1/3)=0 + floor(1/3)=0 =>34; t=2: 2+ floor(98/3)=32 (since 98/3=32.666 floor=32) + floor(0/3)=0 + floor(0/3)=0 =>34? Actually 2+32=34. So ans=34. Check: Use 2 mixing (2,2,2) -> red 98 left -> 32 red bouquets => total 34. Or use 1 mixing + 33 red =34. So max 34. Could we get 35? Total flowers 104, floor(104/3)=34.666 -> max possible 34? Actually floor total/3 = floor(104/3)=34. So 34 is max. So ok.
r=100, g=3, b=0. m=0, only t=0: ans = floor(100/3)=33 + floor(3/3)=1 +0 =34. So ans=34. Achievable: 33 red + 1 green =34. But also could we do mixing? No, b=0. So correct.
r=100, g=3, b=1. m=1 (since min=1?). Actually min = min(100,3,1)=1. t=0: floor(100/3)=33, floor(3/3)=1, floor(1/3)=0 =>34. t=1: 1 + floor(99/3)=33 + floor(2/3)=0 + floor(0/3)=0 =>34. So ans=34. Could we get 35? total flowers=104, floor=34. So no.
Now consider r=100,g=101,b=102. m=100. t=0: floor(100/3)=33, floor(101/3)=33, floor(102/3)=34 sum=100? Actually 33+33+34=100. t=1:1 + floor(99/3)=33 + floor(100/3)=33 + floor(101/3)=33 => 1+33+33+33=100. t=2:2 + floor(98/3)=32 + floor(99/3)=33 + floor(100/3)=33 => 2+32+33+33=100. So ans=100. Is that max? total flowers=303, floor(303/3)=101. Could