C
\nint cmp(const void* a, const void* b){\n    return *(int*)b - *(int*)a ;\n}\nint fillCups(int* amount, int amountSize){\n    qsort(amount, amountSize, sizeof(
```\nint cmp(const void* a, const void* b){\n    return *(int*)b - *(int*)a ;\n}\nint fillCups(int* amount, int amountSize){\n    qsort(amount, amountSize, sizeof(int), cmp) ;\n    if(amount[0] >= (amount[1] + amount[2]))\n        return amount[0] ;\n    else{\n        return amount[0] + (amount[1] + amount[2] - amount[0] + 1) / 2 ;\n    } \n}\n```
[]