{"problem":{"name":"007. Clock Seconds","description":{"content":"You have a clock that tells time in the usual way: hours, minutes, and seconds. When you wake up in the morning, you want to figure out how many seconds you slept for. Conveniently, you fell asleep th","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10269007"},"statements":[{"statement_type":"Markdown","content":"You have a clock that tells time in the usual way: hours, minutes, and seconds. When you wake up in the morning, you want to figure out how many seconds you slept for. Conveniently, you fell asleep the night before at exactly 12:00 AM. Remember that there are 60 seconds in a minute and 60 minutes in an hour.\n\nThe first line of input contains a positive integer _h_ indicating the current number of hours displayed on the clock (_1_ <= _h_ <= _11_). The second line of input contains a positive integer _m_ indicating the current number of minutes displayed on the clock (_0_ <= _m_ <= _59_) The third line of input contains a positive integer _s_ indicating the current number of seconds displayed on the clock (_0_ <= _s_ <= _59_) The fourth line of input contains a string _a_ indicating whether it is currently the morning or the afternoon. _a_ will be either _AM_ or _PM_. You are guaranteed to have slept for less than 24 hours. Also, note that _h_ will never equal 12.\n\nPrint a single positive integer _t_: the number of seconds of sleep that you got.\n\n## Input\n\nThe first line of input contains a positive integer _h_ indicating the current number of hours displayed on the clock (_1_ <= _h_ <= _11_). The second line of input contains a positive integer _m_ indicating the current number of minutes displayed on the clock (_0_ <= _m_ <= _59_) The third line of input contains a positive integer _s_ indicating the current number of seconds displayed on the clock (_0_ <= _s_ <= _59_) The fourth line of input contains a string _a_ indicating whether it is currently the morning or the afternoon. _a_ will be either _AM_ or _PM_. You are guaranteed to have slept for less than 24 hours. Also, note that _h_ will never equal 12.\n\n## Output\n\nPrint a single positive integer _t_: the number of seconds of sleep that you got.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ h \\in \\mathbb{Z} $ be the current hour ($1 \\leq h \\leq 11$).  \nLet $ m \\in \\mathbb{Z} $ be the current minute ($0 \\leq m \\leq 59$).  \nLet $ s \\in \\mathbb{Z} $ be the current second ($0 \\leq s \\leq 59$).  \nLet $ a \\in \\{\\text{AM}, \\text{PM}\\} $ be the period indicator.\n\n**Constraints**  \n1. $ 1 \\leq h \\leq 11 $  \n2. $ 0 \\leq m \\leq 59 $  \n3. $ 0 \\leq s \\leq 59 $  \n4. $ a \\in \\{\\text{AM}, \\text{PM}\\} $  \n5. Sleep duration < 24 hours  \n\n**Objective**  \nCompute the total seconds slept, starting from 12:00 AM:  \n$$\nt = \n\\begin{cases}\n3600h + 60m + s & \\text{if } a = \\text{AM} \\\\\n3600(h + 12) + 60m + s & \\text{if } a = \\text{PM}\n\\end{cases}\n$$","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10269007","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}