{"categories":["Codeforces"],"published":"2012-08-31 03:11:13","version":"1.0","url":"https://noriok.hatenablog.com/entry/2012/08/31/031113","author_name":"noriok","height":"190","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fnoriok.hatenablog.com%2Fentry%2F2012%2F08%2F31%2F031113\" title=\"Codeforces 139A - A. Petr and Book - n-diary\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","provider_url":"https://hatena.blog","provider_name":"Hatena Blog","description":"139A - A. Petr and Book calc :: Int -> [Int] -> Int calc n pages = calc' n (cycle pages) (cycle [1..7]) where calc' n (p:pages) (d:dayWeek) | n <= p = d | otherwise = calc' (n-p) pages dayWeek main = do s <- getLine t <- getLine print $ calc (read s) (map read $ words t)","author_url":"https://blog.hatena.ne.jp/noriok/","blog_url":"https://noriok.hatenablog.com/","blog_title":"n-diary","image_url":null,"type":"rich","width":"100%","title":"Codeforces 139A - A. Petr and Book"}