{"problem":{"name":"A. Generous Eater","description":{"content":"You have n candies. You want to give as much to your friends as possible, but you have a problem; every time you give two friends a candy each, you can't help but eat one yourself (if you have one lef","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10219A"},"statements":[{"statement_type":"Markdown","content":"You have n candies. You want to give as much to your friends as possible, but you have a problem; every time you give two friends a candy each, you can't help but eat one yourself (if you have one left). You tried to resist after giving the first one, but after giving the second, it was unbearable.\n\nWhat is the maximum number of friends you can give candies to?\n\nThe first line of input contains n (1 ≤ n ≤ 109), the number of candies you have.\n\nOutput a single line with the maximum number of friends you can give candies to.\n\n## Input\n\nThe first line of input contains n (1 ≤ n ≤ 109), the number of candies you have.\n\n## Output\n\nOutput a single line with the maximum number of friends you can give candies to.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ n \\in \\mathbb{Z} $ be the number of candies, with $ 1 \\leq n \\leq 10^9 $.\n\n**Constraints**  \nFor every two candies given to two friends, one candy is consumed by the giver (i.e., a cost of 1 candy per 2 friends).\n\n**Objective**  \nMaximize the number of friends $ f \\in \\mathbb{Z}_{\\geq 0} $ such that:  \n$$\nf \\leq 2 \\left\\lfloor \\frac{n}{3} \\right\\rfloor + \\min\\left(n \\bmod 3, 1\\right)\n$$  \nEquivalently:  \n$$\nf = \\left\\lfloor \\frac{2n}{3} \\right\\rfloor\n$$","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10219A","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}