{"author_name":"obelisk2","title":"paiza \u30aa\u30f3\u30e9\u30a4\u30f3\u30cf\u30c3\u30ab\u30bd\u30f3 vol.6 \u3092\u3084\u3063\u3066\u307f\u305f","type":"rich","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fobelisk.hatenablog.com%2Fentry%2F2017%2F10%2F26%2F202414\" title=\"paiza \u30aa\u30f3\u30e9\u30a4\u30f3\u30cf\u30c3\u30ab\u30bd\u30f3 vol.6 \u3092\u3084\u3063\u3066\u307f\u305f - Camera Obscura\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","height":"190","provider_url":"https://hatena.blog","blog_title":"Camera Obscura","provider_name":"Hatena Blog","description":"\u3053\u308c\u3082\u6311\u6226\u3002\u4f7f\u7528\u8a00\u8a9e\u306f Ruby\u3002\u3069\u308c\u3082\u8d85\u7c21\u5358\u306a\u306e\u3067\u7c21\u6f54\u306b\u3002 \u516d\u6751\u30ea\u30aa \u554f\u984c\u3002\u7d50\u679c\u3002\u30b3\u30fc\u30c9\u3002 operations = [] gets.to_i.times {operations << gets.split.map(&:to_i)} water = coffee = 0.0 operations.each do |op, q| case op when 1 then water += q when 2 then coffee += q when 3 r = 1 - q / (water + coffee) water *= r coffee *= r end end puts (coffee\u2026","width":"100%","url":"https://obelisk.hatenablog.com/entry/2017/10/26/202414","categories":["Ruby","\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u30fb\u30d1\u30ba\u30eb"],"version":"1.0","author_url":"https://blog.hatena.ne.jp/obelisk2/","image_url":null,"published":"2017-10-26 20:24:14","blog_url":"https://obelisk.hatenablog.com/"}