Sweet Problem - codeforces
A. Sweet Problem time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You have three piles of candies: red, green and blue candies: the first pile contains only red candies and there are r r candies in it, the second pile contains only green candies and there are g g candies in it, the third pile contains only blue candies and there are b b candies in it. Each day Tanya eats exactly two candies of different colors. She is free to choose the colors of eaten candies: the only restriction that she can't eat two candies of the same color in a day. Find the maximal number of days Tanya can eat candies? Each day she needs to eat exactly two candies. Input The first line contains integer t t ( 1 ≤ t ≤ 1000 1 ≤ t ≤ 1000 ) — the number of test cases in the input. Then t t test cases follow. Each test case is given as a separate li...
Comments
Post a Comment