覆面算を解く(Ruby/Pythonレクリエーション) ref: http://qiita.com/higuma/items/c44246ebd8e6e4a14a64