{"problem":{"name":"056. Stopwatch issues","description":{"content":"You like to use your stopwatch all the time, but there is one major problem with it. The stopwatch only displays seconds, so when it says 472 seconds have passed you have no idea what that means. Give","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10269056"},"statements":[{"statement_type":"Markdown","content":"You like to use your stopwatch all the time, but there is one major problem with it. The stopwatch only displays seconds, so when it says 472 seconds have passed you have no idea what that means. Given a time in seconds display the years, days, hours, minutes and seconds that have passed.\n\nThe first line is number of seconds that have gone by.\n\nPrint the time that has passed in the following format. \"X years, X days, X hours, X minutes and X seconds\". If the value for any time is 0, do not include it. Also be sure to watch out for plurals and using \"and\". If the time is 0, say \"now\" .\n\n## Input\n\nThe first line is number of seconds that have gone by.\n\n## Output\n\nPrint the time that has passed in the following format. \"X years, X days, X hours, X minutes and X seconds\". If the value for any time is 0, do not include it. Also be sure to watch out for plurals and using \"and\". If the time is 0, say \"now\" .\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ s \\in \\mathbb{Z}_{\\geq 0} $ be the input time in seconds.\n\n**Constants**  \n- $ 1 \\text{ year} = 365 \\times 24 \\times 3600 = 31536000 $ seconds  \n- $ 1 \\text{ day} = 24 \\times 3600 = 86400 $ seconds  \n- $ 1 \\text{ hour} = 3600 $ seconds  \n- $ 1 \\text{ minute} = 60 $ seconds  \n\n**Compute**  \nLet:  \n- $ y = \\left\\lfloor \\frac{s}{31536000} \\right\\rfloor $  \n- $ d = \\left\\lfloor \\frac{s \\bmod 31536000}{86400} \\right\\rfloor $  \n- $ h = \\left\\lfloor \\frac{s \\bmod 86400}{3600} \\right\\rfloor $  \n- $ m = \\left\\lfloor \\frac{s \\bmod 3600}{60} \\right\\rfloor $  \n- $ sec = s \\bmod 60 $  \n\n**Objective**  \nOutput the string:  \n- If $ s = 0 $: \"now\"  \n- Else:  \n  Construct a list of non-zero components:  \n  $ \\text{components} = \\left\\{ (y, \\text{\"year\"}), (d, \\text{\"day\"}), (h, \\text{\"hour\"}), (m, \\text{\"minute\"}), (sec, \\text{\"second\"}) \\right\\} $  \n  For each $ (v, unit) $, if $ v > 0 $, append:  \n  - $ v $ + \" \" + $ unit $ + ( \"s\" if $ v \\neq 1 $ else \"\" )  \n  Join all but the last component with \", \", and the last with \" and \" if more than one component exists.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10269056","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}