結果

問題 No.84 悪の算盤
ユーザー GoryudyumaGoryudyuma
提出日時 2019-04-17 23:06:28
言語 JavaScript
(node v21.7.1)
結果
AC  
実行時間 95 ms / 5,000 ms
コード長 24,903 bytes
コンパイル時間 60 ms
コンパイル使用メモリ 5,248 KB
実行使用メモリ 45,612 KB
最終ジャッジ日時 2024-10-13 01:05:12
合計ジャッジ時間 1,829 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 95 ms
44,332 KB
testcase_01 AC 90 ms
44,328 KB
testcase_02 AC 84 ms
40,748 KB
testcase_03 AC 94 ms
45,612 KB
testcase_04 AC 91 ms
44,456 KB
testcase_05 AC 92 ms
45,612 KB
testcase_06 AC 95 ms
45,612 KB
testcase_07 AC 93 ms
45,612 KB
testcase_08 AC 91 ms
45,228 KB
testcase_09 AC 89 ms
45,352 KB
testcase_10 AC 88 ms
45,352 KB
testcase_11 AC 87 ms
44,712 KB
testcase_12 AC 89 ms
44,840 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

!function(n){var r={};function t(u){if(r[u])return r[u].exports;var e=r[u]={i:u,l:!1,exports:{}};return n[u].call(e.exports,e,e.exports,t),e.l=!0,e.exports}t.m=n,t.c=r,t.d=function(n,r,u){t.o(n,r)||Object.defineProperty(n,r,{enumerable:!0,get:u})},t.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,r){if(1&r&&(n=t(n)),8&r)return n;if(4&r&&"object"==typeof n&&n&&n.__esModule)return n;var u=Object.create(null);if(t.r(u),Object.defineProperty(u,"default",{enumerable:!0,value:n}),2&r&&"string"!=typeof n)for(var e in n)t.d(u,e,function(r){return n[r]}.bind(null,e));return u},t.n=function(n){var r=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(r,"a",r),r},t.o=function(n,r){return Object.prototype.hasOwnProperty.call(n,r)},t.p="",t(t.s=0)}([function(n,r,t){n.exports=t(1)},function(n,r,t){const u=t(2).createInterface(process.stdin,{}),{Elm:e}=t(3),f=e.Worker.init();f.ports.cout.subscribe(n=>{console.log(n)}),u.on("line",n=>{f.ports.cin.send(n)})},function(n,r){n.exports=require("readline")},function(n,r){!function(n){"use strict";function r(n,r,t){return t.a=n,t.f=r,t}function t(n){return r(2,n,function(r){return function(t){return n(r,t)}})}function u(n){return r(3,n,function(r){return function(t){return function(u){return n(r,t,u)}}})}function e(n){return r(4,n,function(r){return function(t){return function(u){return function(e){return n(r,t,u,e)}}}})}function f(n){return r(5,n,function(r){return function(t){return function(u){return function(e){return function(f){return n(r,t,u,e,f)}}}}})}function i(n){return r(6,n,function(r){return function(t){return function(u){return function(e){return function(f){return function(i){return n(r,t,u,e,f,i)}}}}}})}function o(n,r,t){return 2===n.a?n.f(r,t):n(r)(t)}function a(n,r,t,u){return 3===n.a?n.f(r,t,u):n(r)(t)(u)}function c(n,r,t,u,e){return 4===n.a?n.f(r,t,u,e):n(r)(t)(u)(e)}function b(n,r,t,u,e,f){return 5===n.a?n.f(r,t,u,e,f):n(r)(t)(u)(e)(f)}var v={$:0};function s(n,r){return{$:1,a:n,b:r}}var l=t(s);function h(n){for(var r=v,t=n.length;t--;)r=s(n[t],r);return r}function d(n){for(var r=[];n.b;n=n.b)r.push(n.a);return r}var g=u(function(n,r,t){for(var u=[];r.b&&t.b;r=r.b,t=t.b)u.push(o(n,r.a,t.a));return h(u)});e(function(n,r,t,u){for(var e=[];r.b&&t.b&&u.b;r=r.b,t=t.b,u=u.b)e.push(a(n,r.a,t.a,u.a));return h(e)}),f(function(n,r,t,u,e){for(var f=[];r.b&&t.b&&u.b&&e.b;r=r.b,t=t.b,u=u.b,e=e.b)f.push(c(n,r.a,t.a,u.a,e.a));return h(f)}),i(function(n,r,t,u,e,f){for(var i=[];r.b&&t.b&&u.b&&e.b&&f.b;r=r.b,t=t.b,u=u.b,e=e.b,f=f.b)i.push(b(n,r.a,t.a,u.a,e.a,f.a));return h(i)}),t(function(n,r){return h(d(r).sort(function(r,t){return y(n(r),n(t))}))}),t(function(n,r){return h(d(r).sort(function(r,t){var u=o(n,r,t);return u===kn?0:u===Jn?-1:1}))});function $(n,r){for(var t,u=[],e=p(n,r,0,u);e&&(t=u.pop());e=p(t.a,t.b,0,u));return e}function p(n,r,t,u){if(t>100)return u.push(O(n,r)),!0;if(n===r)return!0;if("object"!=typeof n||null===n||null===r)return"function"==typeof n&&E(5),!1;for(var e in n.$<0&&(n=Fn(n),r=Fn(r)),n)if(!p(n[e],r[e],t+1,u))return!1;return!0}var w=t($);t(function(n,r){return!$(n,r)});function y(n,r,t){if("object"!=typeof n)return n===r?0:n<r?-1:1;if(void 0===n.$)return(t=y(n.a,r.a))?t:(t=y(n.b,r.b))?t:y(n.c,r.c);for(;n.b&&r.b&&!(t=y(n.a,r.a));n=n.b,r=r.b);return t||(n.b?1:r.b?-1:0)}t(function(n,r){return y(n,r)<0}),t(function(n,r){return y(n,r)<1}),t(function(n,r){return y(n,r)>0}),t(function(n,r){return y(n,r)>=0});var x=t(function(n,r){var t=y(n,r);return t<0?Jn:t?Pn:kn}),A=0;function O(n,r){return{a:n,b:r}}function m(n){return n}function j(n,r){var t={};for(var u in n)t[u]=n[u];for(var u in r)t[u]=r[u];return t}t(M);function M(n,r){if("string"==typeof n)return n+r;if(!n.b)return r;var t=s(n.a,r);n=n.b;for(var u=t;n.b;n=n.b)u=u.b=s(n.a,r);return t}var I=u(function(n,r,t){for(var u=new Array(n),e=0;e<n;e++)u[e]=t(r+e);return u}),C=t(function(n,r){for(var t=new Array(n),u=0;u<n&&r.b;u++)t[u]=r.a,r=r.b;return t.length=u,O(t,r)}),T=(t(function(n,r){return r[n]}),u(function(n,r,t){for(var u=t.length,e=new Array(u),f=0;f<u;f++)e[f]=t[f];return e[n]=r,e}),t(function(n,r){for(var t=r.length,u=new Array(t+1),e=0;e<t;e++)u[e]=r[e];return u[t]=n,u}),u(function(n,r,t){for(var u=t.length,e=0;e<u;e++)r=o(n,t[e],r);return r}),u(function(n,r,t){for(var u=t.length-1;u>=0;u--)r=o(n,t[u],r);return r}));t(function(n,r){for(var t=r.length,u=new Array(t),e=0;e<t;e++)u[e]=n(r[e]);return u}),u(function(n,r,t){for(var u=t.length,e=new Array(u),f=0;f<u;f++)e[f]=o(n,r+f,t[f]);return e}),u(function(n,r,t){return t.slice(n,r)}),u(function(n,r,t){var u=r.length,e=n-u;e>t.length&&(e=t.length);for(var f=new Array(u+e),i=0;i<u;i++)f[i]=r[i];for(i=0;i<e;i++)f[i+u]=t[i];return f}),t(function(n,r){return r}),t(function(n,r){return console.log(n+": <internals>"),r});function E(n){throw new Error("https://github.com/elm/core/blob/1.0.0/hints/"+n+".md")}var N=t(function(n,r){return n+r}),S=(t(function(n,r){return n-r}),t(function(n,r){return n*r})),k=(t(function(n,r){return n/r}),t(function(n,r){return n/r|0}),t(Math.pow));t(function(n,r){return r%n}),t(function(n,r){var t=r%n;return 0===n?E(11):t>0&&n<0||t<0&&n>0?t+n:t}),Math.PI,Math.E,Math.cos,Math.sin,Math.tan,Math.acos,Math.asin,Math.atan,t(Math.atan2);var P=Math.ceil,J=Math.floor,R=(Math.round,Math.sqrt,Math.log);isNaN;t(function(n,r){return n&&r}),t(function(n,r){return n||r}),t(function(n,r){return n!==r});var L=t(function(n,r){return n+r});t(function(n,r){return n+r});t(function(n,r){for(var t=r.length,u=new Array(t),e=0;e<t;){var f=r.charCodeAt(e);55296<=f&&f<=56319?(u[e]=n(m(r[e]+r[e+1])),e+=2):(u[e]=n(m(r[e])),e++)}return u.join("")}),t(function(n,r){for(var t=[],u=r.length,e=0;e<u;){var f=r[e],i=r.charCodeAt(e);e++,55296<=i&&i<=56319&&(f+=r[e],e++),n(m(f))&&t.push(f)}return t.join("")});u(function(n,r,t){for(var u=t.length,e=0;e<u;){var f=t[e],i=t.charCodeAt(e);e++,55296<=i&&i<=56319&&(f+=t[e],e++),r=o(n,m(f),r)}return r});var F=u(function(n,r,t){for(var u=t.length;u--;){var e=t[u],f=t.charCodeAt(u);56320<=f&&f<=57343&&(e=t[--u]+e),r=o(n,m(e),r)}return r}),_=t(function(n,r){return r.split(n)}),z=t(function(n,r){return r.join(n)});u(function(n,r,t){return t.slice(n,r)});t(function(n,r){for(var t=r.length;t--;){var u=r[t],e=r.charCodeAt(t);if(56320<=e&&e<=57343&&(u=r[--t]+u),n(m(u)))return!0}return!1});var q=t(function(n,r){for(var t=r.length;t--;){var u=r[t],e=r.charCodeAt(t);if(56320<=e&&e<=57343&&(u=r[--t]+u),!n(m(u)))return!1}return!0});t(function(n,r){return r.indexOf(n)>-1}),t(function(n,r){return 0===r.indexOf(n)}),t(function(n,r){return r.length>=n.length&&r.lastIndexOf(n)===r.length-n.length}),t(function(n,r){var t=n.length;if(t<1)return v;for(var u=0,e=[];(u=r.indexOf(n,u))>-1;)e.push(u),u+=t;return h(e)});function B(n){return{$:2,b:n}}B(function(n){return"number"!=typeof n?U("an INT",n):-2147483647<n&&n<2147483647&&(0|n)===n?vr(n):!isFinite(n)||n%1?U("an INT",n):vr(n)}),B(function(n){return"boolean"==typeof n?vr(n):U("a BOOL",n)}),B(function(n){return"number"==typeof n?vr(n):U("a FLOAT",n)}),B(function(n){return vr(Z(n))});var D=B(function(n){return"string"==typeof n?vr(n):n instanceof String?vr(n+""):U("a STRING",n)});t(function(n,r){return{$:6,d:n,b:r}}),t(function(n,r){return{$:7,e:n,b:r}});function G(n,r){return{$:9,f:n,g:r}}t(function(n,r){return{$:10,b:r,h:n}});t(function(n,r){return G(n,[r])}),u(function(n,r,t){return G(n,[r,t])}),e(function(n,r,t,u){return G(n,[r,t,u])}),f(function(n,r,t,u,e){return G(n,[r,t,u,e])}),i(function(n,r,t,u,e,f){return G(n,[r,t,u,e,f])}),r(7,H=function(n,r,t,u,e,f,i){return G(n,[r,t,u,e,f,i])},function(n){return function(r){return function(t){return function(u){return function(e){return function(f){return function(i){return H(n,r,t,u,e,f,i)}}}}}}}),function(n){r(8,n,function(r){return function(t){return function(u){return function(e){return function(f){return function(i){return function(o){return function(a){return n(r,t,u,e,f,i,o,a)}}}}}}}})}(function(n,r,t,u,e,f,i,o){return G(n,[r,t,u,e,f,i,o])}),function(n){r(9,n,function(r){return function(t){return function(u){return function(e){return function(f){return function(i){return function(o){return function(a){return function(c){return n(r,t,u,e,f,i,o,a,c)}}}}}}}}})}(function(n,r,t,u,e,f,i,o,a){return G(n,[r,t,u,e,f,i,o,a])}),t(function(n,r){try{return X(n,JSON.parse(r))}catch(n){return br(o(sr,"This is not valid JSON! "+n.message,Z(r)))}});var H,W=t(function(n,r){return X(n,nn(r))});function X(n,r){switch(n.$){case 2:return n.b(r);case 5:return null===r?vr(n.c):U("null",r);case 3:return K(r)?Y(n.b,r,h):U("a LIST",r);case 4:return K(r)?Y(n.b,r,Q):U("an ARRAY",r);case 6:var t=n.d;if("object"!=typeof r||null===r||!(t in r))return U("an OBJECT with a field named `"+t+"`",r);var u=X(n.b,r[t]);return Sn(u)?u:br(o(lr,t,u.a));case 7:var e=n.e;if(!K(r))return U("an ARRAY",r);if(e>=r.length)return U("a LONGER array. Need index "+e+" but only see "+r.length+" entries",r);u=X(n.b,r[e]);return Sn(u)?u:br(o(hr,e,u.a));case 8:if("object"!=typeof r||null===r||K(r))return U("an OBJECT",r);var f=v;for(var i in r)if(r.hasOwnProperty(i)){u=X(n.b,r[i]);if(!Sn(u))return br(o(lr,i,u.a));f=s(O(i,u.a),f)}return vr(Yn(f));case 9:for(var a=n.f,c=n.g,b=0;b<c.length;b++){u=X(c[b],r);if(!Sn(u))return u;a=a(u.a)}return vr(a);case 10:u=X(n.b,r);return Sn(u)?X(n.h(u.a),r):u;case 11:for(var l=v,d=n.g;d.b;d=d.b){u=X(d.a,r);if(Sn(u))return u;l=s(u.a,l)}return br(dr(Yn(l)));case 1:return br(o(sr,n.a,Z(r)));case 0:return vr(n.a)}}function Y(n,r,t){for(var u=r.length,e=new Array(u),f=0;f<u;f++){var i=X(n,r[f]);if(!Sn(i))return br(o(hr,f,i.a));e[f]=i.a}return vr(t(e))}function K(n){return Array.isArray(n)||"undefined"!=typeof FileList&&n instanceof FileList}function Q(n){return o(or,n.length,function(r){return n[r]})}function U(n,r){return br(o(sr,"Expecting "+n,Z(r)))}var V=t(function(n,r){return JSON.stringify(nn(r),null,n)+""});function Z(n){return n}function nn(n){return n}u(function(n,r,t){return t[n]=nn(r),t});Z(null);function rn(n){return{$:0,a:n}}function tn(n){return{$:2,b:n,c:null}}var un=t(function(n,r){return{$:3,b:n,d:r}});t(function(n,r){return{$:4,b:n,d:r}});var en=0;function fn(n){var r={$:0,e:en++,f:n,g:null,h:[]};return vn(r),r}function on(n,r){n.h.push(r),vn(n)}var an=t(function(n,r){return tn(function(t){on(n,r),t(rn(A))})});var cn=!1,bn=[];function vn(n){if(bn.push(n),!cn){for(cn=!0;n=bn.shift();)sn(n);cn=!1}}function sn(n){for(;n.f;){var r=n.f.$;if(0===r||1===r){for(;n.g&&n.g.$!==r;)n.g=n.g.i;if(!n.g)return;n.f=n.g.b(n.f.a),n.g=n.g.i}else{if(2===r)return void(n.f.c=n.f.b(function(r){n.f=r,vn(n)}));if(5===r){if(0===n.h.length)return;n.f=n.f.b(n.h.shift())}else n.g={$:3===r?0:1,b:n.f.b,i:n.g},n.f=n.f.d}}}var ln=e(function(n,r,t,u){return function(n,r,t,u,e,f){var i=o(W,n,Z(r?r.flags:void 0));Sn(i)||E(2);var a={},c=(i=t(i.a)).a,b=f(s,c),v=function(n,r){var t;for(var u in hn){var e=hn[u];e.a&&((t=t||{})[u]=e.a(u,r)),n[u]=dn(e,r)}return t}(a,s);function s(n,r){i=o(u,n,c),b(c=i.a,r),$n(a,i.b,e(c))}return $n(a,i.b,e(c)),v?{ports:v}:{}}(r,u,n.aw,n.aH,n.aF,function(){return function(){}})});var hn={};function dn(n,r){var t={g:r,h:void 0},u=n.c,e=n.d,f=n.e,i=n.f;return t.h=fn(o(un,function n(r){return o(un,n,{$:5,b:function(n){var o=n.a;return 0===n.$?a(e,t,o,r):f&&i?c(u,t,o.i,o.j,r):a(u,t,f?o.i:o.j,r)}})},n.b))}t(function(n,r){return tn(function(t){n.g(r),t(rn(A))})}),t(function(n,r){return o(an,n.h,{$:0,a:r})});function gn(n){return function(r){return{$:1,k:n,l:r}}}t(function(n,r){return{$:3,n:n,o:r}});function $n(n,r,t){var u={};for(var e in pn(!0,r,u,null),pn(!1,t,u,null),n)on(n[e],{$:"fx",a:u[e]||{i:v,j:v}})}function pn(n,r,t,u){switch(r.$){case 1:var e=r.k,f=function(n,r,t,u){return o(n?hn[r].e:hn[r].f,function(n){for(var r=t;r;r=r.q)n=r.p(n);return n},u)}(n,e,u,r.l);return void(t[e]=function(n,r,t){return t=t||{i:v,j:v},n?t.i=s(r,t.i):t.j=s(r,t.j),t}(n,f,t[e]));case 2:for(var i=r.m;i.b;i=i.b)pn(n,i.a,t,u);return;case 3:return void pn(n,r.o,t,{p:r.n,q:u})}}function wn(n){hn[n]&&E(3)}var yn=t(function(n,r){return r});function xn(n){var r,t=[],e=hn[n].r,f=(r=0,tn(function(n){var t=setTimeout(function(){n(rn(A))},r);return function(){clearTimeout(t)}}));return hn[n].b=f,hn[n].c=u(function(n,r,u){for(;r.b;r=r.b)for(var i=t,o=nn(e(r.a)),a=0;a<i.length;a++)i[a](o);return f}),{subscribe:function(n){t.push(n)},unsubscribe:function(n){var r=(t=t.slice()).indexOf(n);r>=0&&t.splice(r,1)}}}var An=t(function(n,r){return function(t){return n(r(t))}});function On(n,r){var t=v,e=hn[n].r,f=rn(null);return hn[n].b=f,hn[n].c=u(function(n,r,u){return t=r,f}),{send:function(n){var u=o(W,e,Z(n));Sn(u)||E(4,u.a);for(var f=u.a,i=t;i.b;i=i.b)r(i.a(f))}}}var mn=t(function(n,r){var t="g";n.X&&(t+="m"),n.O&&(t+="i");try{return ar(new RegExp(r,t))}catch(n){return cr}}),jn=t(function(n,r){return null!==r.match(n)});u(function(n,r,t){for(var u,e=[],f=0,i=t,o=r.lastIndex,a=-1;f++<n&&(u=r.exec(i))&&a!=r.lastIndex;){for(var b=u.length-1,v=new Array(b);b>0;){var s=u[b];v[--b]=s?ar(s):cr}e.push(c(Yt,u[0],u.index,f,h(v))),a=r.lastIndex}return r.lastIndex=o,h(e)}),e(function(n,r,t,u){var e=0;return u.replace(r,function(r){if(e++>=n)return r;for(var u=arguments.length-3,f=new Array(u);u>0;){var i=arguments[u];f[--u]=i?ar(i):cr}return t(c(Yt,r,arguments[arguments.length-2],e,h(f)))})}),u(function(n,r,t){for(var u=t,e=[],f=r.lastIndex,i=r.lastIndex;n--;){var o=r.exec(u);if(!o)break;e.push(u.slice(f,o.index)),f=r.lastIndex}return e.push(u.slice(f)),r.lastIndex=i,h(e)}),t(function(n,r){return n&r}),t(function(n,r){return n|r}),t(function(n,r){return n^r});t(function(n,r){return r<<n}),t(function(n,r){return r>>n}),t(function(n,r){return r>>>n});var Mn,In,Cn,Tn,En,Nn,Sn=function(n){return!n.$},kn=1,Pn=2,Jn=0,Rn=u(function(n,r,t){for(;;){if(-2===t.$)return r;var u=t.b,e=t.c,f=t.d,i=t.e,o=n,c=a(n,u,e,a(Rn,n,r,i));n=o,r=c,t=f}}),Ln=l,Fn=function(n){return a(Rn,u(function(n,r,t){return o(Ln,O(n,r),t)}),v,n)},_n=T,zn=(u(function(n,r,u){var e=u.c,f=u.d,i=t(function(r,t){if(r.$){var u=r.a;return a(_n,n,t,u)}var e=r.a;return a(_n,i,t,e)});return a(_n,i,a(_n,n,r,f),e)}),e(function(n,r,t,u){return{$:0,a:n,b:r,c:t,d:u}})),qn=P,Bn=t(function(n,r){return R(r)/R(n)}),Dn=qn(o(Bn,2,32)),Gn=[],Hn=c(zn,0,Dn,Gn,Gn),Wn=C,Xn=u(function(n,r,t){for(;;){if(!t.b)return r;var u=t.a,e=t.b,f=n,i=o(n,u,r);n=f,r=i,t=e}}),Yn=function(n){return a(Xn,Ln,v,n)},Kn=t(function(n,r){for(;;){var t=o(Wn,32,n),u=t.a,e=t.b,f=o(Ln,{$:0,a:u},r);if(!e.b)return Yn(f);n=e,r=f}}),Qn=(t(function(n,r){return r(n)}),w),Un=function(n){return n.a},Vn=t(function(n,r){for(;;){var t=qn(r/32);if(1===t)return o(Wn,32,n).a;n=o(Kn,n,v),r=t}}),Zn=N,nr=(t(function(n,r){return n(r)}),J),rr=t(function(n,r){return y(n,r)>0?n:r}),tr=S,ur=function(n){return n.length},er=t(function(n,r){if(r.a){var t=32*r.a,u=nr(o(Bn,32,t-1)),e=n?Yn(r.d):r.d,f=o(Vn,e,r.a);return c(zn,ur(r.c)+t,o(rr,5,u*Dn),f,r.c)}return c(zn,ur(r.c),Dn,Gn,r.c)}),fr=I,ir=f(function(n,r,t,u,e){for(;;){if(r<0)return o(er,!1,{d:u,a:t/32|0,c:e});var f={$:1,a:a(fr,32,r,n)};n=n,r=r-32,t=t,u=o(Ln,f,u),e=e}}),or=t(function(n,r){if(n<=0)return Hn;var t=n%32,u=a(fr,t,n-t,r);return b(ir,r,n-t-32,n,v,u)}),ar=function(n){return{$:0,a:n}},cr={$:1},br=function(n){return{$:1,a:n}},vr=function(n){return{$:0,a:n}},sr=t(function(n,r){return{$:3,a:n,b:r}}),lr=t(function(n,r){return{$:0,a:n,b:r}}),hr=t(function(n,r){return{$:1,a:n,b:r}}),dr=function(n){return{$:2,a:n}},gr=function(n){var r=n.charCodeAt(0);return 55296<=r&&r<=56319?1024*(r-55296)+n.charCodeAt(1)-56320+65536:r},$r=function(n){var r=gr(n);return 97<=r&&r<=122},pr=function(n){var r=gr(n);return r<=90&&65<=r},wr=function(n){return $r(n)||pr(n)},yr=function(n){return $r(n)||pr(n)||function(n){var r=gr(n);return r<=57&&48<=r}(n)},xr=function(n){return a(Xn,t(function(n,r){return r+1}),0,n)},Ar=g,Or=u(function(n,r,t){for(;;){if(!(y(n,r)<1))return t;var u=n,e=r-1,f=o(Ln,r,t);n=u,r=e,t=f}}),mr=t(function(n,r){return a(Or,n,r,v)}),jr=t(function(n,r){return a(Ar,n,o(mr,0,xr(r)-1),r)}),Mr=q,Ir=function(n){return n+""},Cr=t(function(n,r){return o(z,n,d(r))}),Tr=function(n){var r=n.charCodeAt(0);return r?ar(55296<=r&&r<=56319?O(m(n[0]+n[1]),n.slice(2)):O(m(n[0]),n.slice(1))):cr},Er=t(function(n,r){return h(o(_,n,r))}),Nr=function(n){return o(Cr,"\n    ",o(Er,"\n",n))},Sr=V,kr=t(function(n,r){return"\n\n("+Ir(n+1)+") "+Nr(Pr(r))}),Pr=function(n){return o(Jr,n,v)},Jr=t(function(n,r){n:for(;;)switch(n.$){case 0:var t=n.a,u=n.b,e=function(){var n=Tr(t);if(1===n.$)return!1;var r=n.a,u=r.a,e=r.b;return wr(u)&&o(Mr,yr,e)}(),f=u,i=o(Ln,e?"."+t:"['"+t+"']",r);n=f,r=i;continue n;case 1:var a=n.a,c=(u=n.b,"["+Ir(a)+"]");f=u,i=o(Ln,c,r);n=f,r=i;continue n;case 2:var b=n.a;if(b.b){if(b.b.b){var v=(r.b?"The Json.Decode.oneOf at json"+o(Cr,"",Yn(r)):"Json.Decode.oneOf")+" failed in the following "+Ir(xr(b))+" ways:";return o(Cr,"\n\n",o(Ln,v,o(jr,kr,b)))}n=f=u=b.a,r=i=r;continue n}return"Ran into a Json.Decode.oneOf with no possibilities"+(r.b?" at json"+o(Cr,"",Yn(r)):"!");default:var s=n.a,l=n.b;return(v=r.b?"Problem with the value at json"+o(Cr,"",Yn(r))+":\n\n    ":"Problem with the given value:\n\n")+(Nr(o(Sr,4,l))+"\n\n")+s}}),Rr=function(n){return{$:2,m:n}}(v),Lr=O({N:"",z:0},Rr),Fr=t(function(n,r){return{$:0,a:n,b:r}}),_r=(In=D,wn(Mn="cin"),hn[Mn]={f:An,r:In,a:On},gn(Mn)),zr=function(n,r){return wn(n),hn[n]={e:yn,r:r,a:xn},gn(n)}("cout",Z),qr=t(function(n,r){return{$:0,a:n,b:r}}),Br=function(n){var r=function(n){n:for(;;){if(n.b){if(n.b.b){n=n.b;continue n}var r=n.a;return ar(r)}return cr}}(n);return 1!==r.$&&r.a<0},Dr=function(n){return{$:1,a:n}},Gr=function(n){return{$:0,a:n}},Hr={$:2},Wr=function(n){return!n.b},Xr=t(function(n,r){if(Wr(r))return Hr;switch(n){case 2:return Hr;case 0:return Gr(r);default:return Dr(r)}}),Yr=function(n){return n},Kr=t(function(n,r){return o(qr,n,r)}),Qr=e(function(n,r,t,u){if(u.b){var e=u.a,f=u.b;if(f.b){var i=f.a,b=f.b;if(b.b){var v=b.a,s=b.b;if(s.b){var l=s.a,h=s.b;return o(n,e,o(n,i,o(n,v,o(n,l,t>500?a(Xn,n,r,Yn(h)):c(Qr,n,r,t+1,h)))))}return o(n,e,o(n,i,o(n,v,r)))}return o(n,e,o(n,i,r))}return o(n,e,r)}return r}),Ur=u(function(n,r,t){return c(Qr,n,r,0,t)}),Vr=(Cn=Qn(0),o(Ur,t(function(n,r){return Cn(n)&&Wr(r)?v:o(Ln,n,r)}),v)),Zr=k,nt=-1+o(Zr,10,7),rt=nt+1,tt=t(function(n,r){var t=r.a,u=r.b;return O(n(t),u)}),ut=function(n){return n<0?o(tt,Zn(-1),ut(n+rt)):O(n/rt|0,n%rt)},et=t(function(n,r){for(;;){if(r.b){var t=r.a,u=r.b,e=ut(t+n),f=e.a,i=e.b;return o(Ln,i,o(et,f,u))}if(!(y(n,rt)>0))return h([n]);var a=h([n]);n=0,r=a}}),ft=function(n){return Vr(o(et,0,n))},it=t(function(n,r){return a(Ur,t(function(r,t){return o(Ln,n(r),t)}),v,r)}),ot=it(function(n){return-n}),at=function(n){switch(n){case 0:return 1;case 1:return 0;default:return 2}},ct=function(n){for(;;){var r=n.a,t=n.b,u=ft(t);if(!Br(u))return o(Xr,r,u);n=o(Kr,at(r),ot(u))}},bt=t(function(n,r){var t=O(n,r);if(t.a.b){if(t.b.b){var u=t.a,e=(i=u.a,a=u.b,t.b);b=e.a,s=e.b;return o(Ln,O(i,b),o(bt,a,s))}var f=t.a,i=f.a,a=f.b;return o(Ln,O(i,0),o(bt,a,v))}if(t.b.b){var c=t.b,b=c.a,s=c.b;return o(Ln,O(0,b),o(bt,v,s))}return v}),vt=t(function(n,r){return o(bt,n,r)}),st=function(n){switch(n.$){case 2:return o(Kr,2,v);case 1:var r=n.a;return o(Kr,0,ot(r));default:r=n.a;return o(Kr,0,r)}},lt=t(function(n,r){var t=st(r).b,u=st(n).b,e=o(vt,u,t),f=o(it,function(n){return n.a+n.b},e);return ct(o(qr,0,f))}),ht=function(n){switch(n.$){case 2:return Hr;case 1:var r=n.a;return Gr(r);default:return n}},dt=x,gt=function(n){return ct(o(qr,function(n){switch(o(dt,n,0)){case 0:return 1;case 2:return 0;default:return 2}}(n),h([(r=n,r<0?-r:r)])));var r},$t=e(function(n,r,t,u){n:for(;;){var e=O(t,u);if(e.a.b){if(e.b.b){var f=e.a,i=f.a,a=f.b,c=e.b,b=c.a,v=c.b;if($(i,b)){n=n,r=r,t=a,u=v;continue n}n=i,r=b,t=a,u=v;continue n}return 2}return e.b.b?0:o(dt,n,r)}}),pt=t(function(n,r){var t=O(n,r);switch(t.a.$){case 0:if(t.b.$)return 2;var u=t.a.a,e=t.b.a;return c($t,0,0,u,e);case 1:if(1===t.b.$){u=t.a.a,e=t.b.a;return function(n){switch(n){case 0:return 2;case 1:return 1;default:return 0}}(c($t,0,0,u,e))}return 0;default:switch(t.b.$){case 0:t.a;return 0;case 2:t.a,t.b;return 1;default:t.a;return 2}}}),wt=t(function(n,r){return 2===o(pt,n,r)}),yt=t(function(n,r){return!o(wt,n,r)}),xt=function(n){switch(n.$){case 2:return v;case 0:default:return n.a}},At=t(function(n,r){var t=n;return ft(o(it,tr(r),t))}),Ot=t(function(n,r){var t=n,u=r;if(t.b){if(t.b.b){c=t.a;var e=t.b,f=o(At,u,c),i=o(Ot,e,u),a=o(lt,o(Xr,0,f),o(Xr,0,o(Ln,0,i)));return xt(a)}var c=t.a;return o(At,u,c)}return v}),mt=function(n){switch(n.$){case 2:return 2;case 0:return 0;default:return 1}},jt=t(function(n,r){return 2===n||2===r?2:$(n,r)?0:1}),Mt=t(function(n,r){return o(Xr,o(jt,mt(n),mt(r)),o(Ot,xt(n),xt(r)))}),It=t(function(n,r){return o(lt,n,function(n){switch(n.$){case 2:return Hr;case 0:var r=n.a;return Dr(r);default:return r=n.a,Gr(r)}}(r))}),Ct=gt(0),Tt=e(function(n,r,t,u){if(n){var e=gt(n),f=o(Mt,o(Mt,e,u),r),i=o(yt,f,t)?O(o(Mt,e,r),o(It,t,f)):O(Ct,t),a=i.a,b=i.b,v=c(Tt,n/2|0,r,b,u),s=v.a,l=v.b;return O(o(lt,a,s),l)}return O(Ct,t)}),Et=qn(o(Bn,2,nt)),Nt=u(function(n,r,t){return c(Tt,o(Zr,2,Et),n,r,t)}),St=gt(1),kt=t(function(n,r){return n}),Pt=u(function(n,r,t){return a(Xn,kt(n),r,o(mr,1,t))}),Jt=function(n){return a(Pt,Mt(gt(rt)),St,n)},Rt=u(function(n,r,t){if(n){var u=a(Nt,Jt(n),r,t),e=u.a,f=u.b,i=a(Rt,n-1,f,t),c=i.a,b=i.b;return O(o(lt,e,c),b)}return a(Nt,Jt(n),r,t)}),Lt=function(n){switch(n.$){case 2:return v;case 0:default:return n.a}},Ft=t(function(n,r){if($(r,Ct))return cr;var t=xr(Lt(n))-xr(Lt(r))+1,u=a(Rt,o(rr,0,t),ht(n),ht(r)),e=u.a,f=u.b;return ar(O(o(Xr,o(jt,mt(n),mt(r)),xt(e)),o(Xr,mt(n),xt(f))))}),_t=t(function(n,r){if(r.$)return cr;var t=r.a;return ar(n(t))}),zt=t(function(n,r){return r.$?n:r.a}),qt=t(function(n,r){return o(zt,Ct,o(_t,Un,o(Ft,n,r)))}),Bt=t(function(n,r){n:for(;;){if(r.b){var t=r.a,u=r.b;if(n(t)){n=n,r=u;continue n}return r}return v}}),Dt=function(n){var r=n;return o(Bt,Qn(0),r).b?r:v},Gt=u(function(n,r,t){return n(r(t))}),Ht=u(function(n,r,t){return r(n(t))}),Wt=function(n){return d(n).join("")},Xt=function(n){for(var r=0,t=n.charCodeAt(0),u=43==t||45==t?1:0,e=u;e<n.length;++e){var f=n.charCodeAt(e);if(f<48||57<f)return cr;r=10*r+f-48}return e==u?cr:ar(45==t?-r:r)},Yt=e(function(n,r,t,u){return{av:r,ax:n,az:t,aE:u}}),Kt=jn,Qt=mn,Ut=/.^/,Vt=t(function(n,r){for(;;){if(n<=0)return r;if(!r.b)return r;r.a;n=n-1,r=r.b}}),Zt=u(function(n,r,t){for(;;){if(n<=0)return t;if(!r.b)return t;var u=r.a;n=n-1,r=r.b,t=o(Ln,u,t)}}),nu=t(function(n,r){return Yn(a(Zt,n,r,v))}),ru=u(function(n,r,t){if(r<=0)return v;var u=O(r,t);n:for(;;){r:for(;;){if(!u.b.b)return t;if(!u.b.b.b){if(1===u.a)break n;break r}switch(u.a){case 1:break n;case 2:var e=u.b;return h([i=e.a,l=e.b.a]);case 3:if(u.b.b.b.b){var f=u.b,i=f.a,c=f.b;return h([i,l=c.a,g=c.b.a])}break r;default:if(u.b.b.b.b&&u.b.b.b.b.b){var b=u.b,i=b.a,s=b.b,l=s.a,d=s.b,g=d.a,$=d.b,p=$.a,w=$.b;return o(Ln,i,o(Ln,l,o(Ln,g,o(Ln,p,n>1e3?o(nu,r-4,w):a(ru,n+1,r-4,w)))))}break r}}return t}return h([i=u.b.a])}),tu=t(function(n,r){return a(ru,0,n,r)}),uu=u(function(n,r,t){var u=o(Vt,r,t),e=xr(t)>0;return n>0&&r>0&&e?o(Ln,o(tu,n,t),a(uu,n,r,u)):v}),eu=t(function(n,r){return a(uu,n,n,r)}),fu=(Tn=Yr,En=t(function(n,r){var t=Tn(n);if(1===t.$)return cr;var u=t.a;return o(_t,Ln(u),r)}),o(Ur,En,ar(v))),iu=function(n){return o(Kt,o(zt,Ut,o(Qt,{O:!1,X:!1},"^[0-9]")),Wt(n))?o(_t,o(Gt,Dt,Yr),fu(o(it,o(Ht,Yn,o(Ht,Wt,Xt)),o(eu,7,Yn(n))))):cr},ou=F,au=function(n){return n.toLowerCase()},cu=function(n){var r,t=(r=au(n),a(ou,Ln,v,r));if(!t.b)return cr;switch(t.a){case"-":if(t.b.b){var u=t.b;return o(_t,Xr(1),iu(u))}return cr;case"+":if(t.b.b){u=t.b;return o(_t,Xr(0),iu(u))}return cr;default:u=t;return o(_t,Xr(0),iu(u))}},bu=L,vu=function(n){return n.length},su=u(function(n,r,t){return n<=0?t:a(su,n>>1,M(r,r),1&n?M(t,r):t)}),lu=t(function(n,r){return a(su,n,r,"")}),hu=u(function(n,r,t){return M(o(lu,n-vu(t),function(n){return o(bu,n,"")}(r)),t)}),du=o(Gt,o(hu,7,"0"),Ir),gu=function(n){var r,t=Yn(n);if(t.b){var u=t.a,e=t.b;return r=o(Ln,Ir(u),o(it,du,e)),o(Cr,"",r)}return"0"},$u=function(n){switch(n.$){case 2:return"0";case 0:var r=n.a;return gu(r);default:r=n.a;return"-"+gu(r)}},pu=function(n){if(n.b){var r=n.a;n.b;return ar(r)}return cr},wu=function(n){return{$:0,a:n}},yu=ln({aw:function(n){return Lr},aF:function(n){return _r(Fr(n.z))},aH:t(function(n,r){var t=n.a,u=n.b;if(t)return O(j(r,{z:t+1}),Rr);var e,f,i=o(it,function(n){return n.$?gt(0):n.a},o(it,cu,o(Er," ",u))),a=(f=pu(Yn(i))).$?gt(0):f.a,c=(e=pu(i)).$?gt(0):e.a;return O(j(r,{z:t+1}),zr($(c,a)?$u(o(qt,o(lt,gt(-1),o(Mt,c,a)),gt(4))):$u(o(qt,o(lt,gt(-1),o(Mt,c,a)),gt(2)))))})});Nn={Worker:{init:yu(wu(0))(0)}},n.Elm?function n(r,t){for(var u in t)u in r?"init"==u?E(6):n(r[u],t[u]):r[u]=t[u]}(n.Elm,Nn):n.Elm=Nn}(this)}]);
0