r5 vs r6
......
299299
}}}{{{#!if tw=(+au.substr(0,i))*(+bu.substr(17-i,1)), rs=rs+tw, i+=1
300300
}}}}}}
301301
##=== 나눗셈 ===
302
a와 b 모두 0이 아닌 경우에서 나눗셈을 연산하는 과정입니다.
303302
{{{#!if (f=="/")&&((+au!=0)||(+ab!=0))&&((+bu!=0)||(+bb!=0))
304
305
au, ab, bu, bb를 18자로 만들었으므로 36자리 정수의 나눗셈으로 봅니다.
306
a/b=(au+ab)/(bu+bb)=(+(au.substr(0,18)+ab.substr(0,18)))/(+(bu.substr(0,18)+bb.substr(0,18)))와 같습니다.
307
308
##몫 서술
309
제일 높은 자리부터 내려오면서 처음으로 0이 아닌 수를 왼쪽으로 당기는 과정을 거쳤으므로 (1부터 시작하는 18자리+18자리 숫자)/(1부터 시작하는 18자리+18자리 수) 연산이 됩니다.
310
311
{{{#!if ps=false
312
}}}ps를 false로 초기화합니다. 변수에 값을 주는 여부로 ps를 사용합니다.
313
314303
##i=0
315
{{{#!if br=false
316
}}}다시 정렬된 bu, bb의 값은 바뀌지 않습니다. bu, bb로 나눈 몫만큼 au, ab에서 감소시킨 다음 au와 ab를 다시 정렬시키며, au와 ab가 모두 0이 되면 더 이상 계산하지 않도록 br를 true로 반환합니다.
317
그 다음 계산을 편하게 할 수 있도록 텍스트값으로 된 au, ab, bu, bb를 정수값으로 변환합니다.
318
{{{#!if au=+au, ab=+ab, bu=+bu, bb=+bb
319
}}}
320
321
먼저 au를 bu로 나눈 몫을 tw로 정의합니다. 정수를 정수로 나누면 몫만 계산되며, 100,000,000,000,000,000 이상 999,999,999 999,999,999 이하의 한 정수를 100,000,000,000,000,000 이상의 다른 한 정수로 나눈 몫이므로 tw의 값은 최소 0 최대 9가 됩니다.
322
{{{#!if tw=au/bu
323
}}}
324
bu, bb를 각각 tw만큼 곱한 값을 tx, ty로 정의합니다.
325
{{{#!if tx=bu*tw, ty=bb*tw
326
}}}
327
ty가 19자리가 되면 넘친 첫번째 자리의 값을 tx의 일의 자리로 더하고 아래 18자리의 값을 ty로 다시 정의합니다. tx는 19자리 숫자가 되어도 문제가 없습니다. 만일 ty가 19자리가 되지 않는다면 tx와 ty를 그대로 둡니다. 그 다음 ty를 정수로 바꿉니다.
328
{{{#!if ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty
329
}}}
330
이렇게 하면 tx=bu*tw<=au가 됩니다. (bu가 au보다 크면 tw는 tw의 정의에서 값이 0이 되므로 부등호가 성립됩니다.)
331
332
(2.1/1.6 처럼) ty가 넘쳐 tx 값이 더해지는 경우가 있으므로 몫이 유효한 값인지 검산합니다. 만일 tx ty 가 기존 au ab을 넘게 되면 tw에서 1을 빼고, tx, ty를 다시 정의합니다. 그러나 tw가 이미 0이 되었을 경우 tw를 0으로 둡니다.
333
{{{#!if (tx>au)||((tx==au)&&(ty>ab))
334
{{{#!if tw=(tw==0)?0:tw-1, tx=bu*tw, ty=bb*tw
335
}}}
336
마찬가지로 ty가 19자리가 된다면 넘친 첫번째 자리의 값을 tx의 일의 자리로 더합니다. 그 다음 ty를 정수로 바꿉니다.
337
{{{#!if ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty
338
}}}
339
}}}
340
이렇게 만들어진 tx, ty가 있으면 이를 반영합니다.
341
au에서 tx를, ab에서 ty를 뺍니다. 만약 ty>ab일 경우 au에서 1을 가져와 (au에서 1을 빼고) ab에 1,000,000,000,000,000,000을 더한 다음 계산합니다.
342
{{{#!if ty>ab
304
{{{#!if ps=false, br=false, au=+au, ab=+ab, bu=+bu, bb=+bb, tw=au/bu, tx=bu*tw, ty=bb*tw, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty, (tx>au)||((tx==au)&&(ty>ab))
305
{{{#!if tw=(tw==0)?0:tw-1, tx=bu*tw, ty=bb*tw, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty
306
}}}}}}{{{#!if ty>ab
343307
{{{#!if au-=1, ab+=+("1"+pd)
344
}}}}}}
345
{{{#!if au-=tx, ab-=ty
346
}}}
347
몫인 tw를 문자열로 바꾸고 tm의 오른쪽에 더합니다.
348
{{{#!if tw=tw.toString(), tm+=tw
349
}}}
350
au, ab에서 몫을 빼고 나니 au, ab가 모두 0으로 된다면 더 이상 계산을 하지 않아야 하므로 br를 true로 반환합니다.
351
{{{#!if (au==0)&&(ab==0)
308
}}}}}}{{{#!if au-=tx, ab-=ty, tw=tw.toString(), tm+=tw
309
}}}{{{#!if (au==0)&&(ab==0)
352310
{{{#!if br=true
311
}}}}}}{{{#!if !br
312
{{{#!if au=au.toString(), ab=ab.toString(), ps=(au.length==18), tn=ps?au.substr(0,1):"", au=ps?au.substr(1):(pd+au).substr(-17), ab=(ab.length<18)?(pd+ab).substr(-18):ab, au+=ab.substr(0,1), ab=ab.substr(1)+"0"
353313
}}}}}}
354
어느 하나가 0이 되지 않는다면 br는 여전히 false이므로 !br일 때 자릿수를 옮깁니다.
355
{{{#!if !br
356
au, ab를 문자열로 다시 바꿉니다.
357
{{{#!if au=au.toString(), ab=ab.toString()
358
}}}
359
au가 여전히 18자리 숫자일 경우 au의 첫번째 자리를 분리해 내어 tn으로 정의하고 나머지 17자리를 au로 둡니다. 그렇지 않을 경우 (au가 17자리 미만의 숫자가 되었다면) tn은 빈 문자열으로 두고 au의 왼쪽을 0(pd)으로 채운 다음 (적어도 19자리가 되는 문자열을) 뒤에서 17번째 자리부터 가지고 와 au로 만듭니다.
360
{{{#!if ps=(au.length==18), tn=ps?au.substr(0,1):"", au=ps?au.substr(1):(pd+au).substr(-17)
361
}}}
362
ab가 18자리 미만의 숫자가 되었다면 왼쪽을 0으로 채워 18자리 숫자로 만듭니다.
363
{{{#!if ab=(ab.length<18)?(pd+ab).substr(-18):ab
364
}}}
365
au의 뒤로 ab의 처음 자리를 끌어옵니다.
366
{{{#!if au+=ab.substr(0,1)
367
}}}
368
ab의 나머지 17자리를 앞으로 당긴 다음 "0"을 더합니다.
369
{{{#!if ab=ab.substr(1)+"0"
370
}}}
371
여기까지가 자릿수를 한 칸씩 옮기는 과정입니다.
372
}}}
373
##i=1 part 1
374
몫으로 기록할 숫자의 첫번째 자리를 구했다면, 그 다음 자리의 숫자를 찾기 위해 (변수 tn으로 만들 수 있는 여분의 1자리 +) 18자리 + 18자리 숫자를 18자리+18자리 숫자로 나누는 계산을 합니다. tn이 9가 될 경우 9로 시작하는 19자리 숫자를 long integer로 모두 표현할 수 없으므로 10**18 자리부터 먼저 계산합니다. 10**18의 1번째 숫자의 몫을 구한 다음 나머지를 18자리 숫자에 더하는 과정(part 1)을 거친 다음 그 18자리에서 몫을 구하는 과정(part 2)을 거칩니다.
375
376
au와 ab를 정수로 다시 바꾸고 tz를 0으로 초기화합니다. 그리고 tn이 빈 문자열이 아니라면 (앞에 au에서 한 자리 수를 떼온 것이므로) tn에 0을 더하여 19자리로 만들고 몫을 구합니다.
314
##i=1
377315
{{{#!if au=+au, ab=+ab, tz=0, !br&&(tn!="")
378
tn을 19자리 정수로 바꿉니다.
379
{{{#!if tn+=pd, tn=+tn
380
}}}
381
tz를 몫으로 정의합니다. 앞의 tw를 처리하는 방법과 같습니다. tn을 정수로 만들었으므로 소수점 아래를 비교한다면 정수의 소수점 아래에 해당하는 0과 비교합니다.
382
{{{#!if tz=tn/bu, tx=bu*tz, ty=bb*tz, ty=ty.toString()
383
}}}
384
마찬가지로 ty가 19자리 숫자이면 1자리를 떼어 tx에 더합니다.
385
{{{#!if ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty
386
}}}
387
앞의 tw를 처리할 때 au와 tx를 비교한 것처럼 tz를 처리할 때 tn와 tx를 비교합니다.
388
{{{#!if (tx>tn)||((tx==tn)&&(ty>0))
389
{{{#!if tz=(tz==0)?0:tz-1, tx=bu*tz, ty=bb*tz
390
}}}{{{#!if ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty
391
}}}}}}
392
tn에서 나누어떨어지는 값을 뺀 나머지를 반영하여 au, ab에 더합니다. 소수점 아래 부분인 ab보다 ty가 크다면 tn에서 1을 빼어 계산합니다.
393
{{{#!if ty>ab
316
{{{#!if tn+=pd, tn=+tn, tz=tn/bu, tx=bu*tz, ty=bb*tz, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty, (tx>tn)||((tx==tn)&&(ty>0))
317
{{{#!if tz=(tz==0)?0:tz-1, tx=bu*tz, ty=bb*tz, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty
318
}}}}}}{{{#!if ty>ab
394319
{{{#!if tn-=1, ab+=+("1"+pd)
395
}}}}}}
396
{{{#!if au+=(tn-tx), ab-=ty
397
}}}
398
tn을 빈 문자열로 초기화합니다.
399
{{{#!if tn=""
400
}}}
401
}}}
402
##i=1 part 2
403
br(0으로 나누어떨어짐) 이 걸려있으면 실행하지 않습니다. 그러므로 전체적으로 조건을 !br로 둔 다음 계산을 진행합니다.
404
{{{#!if !br
405
tw, tx, ty를 정의하고 처리하는 과정은 앞자리에서 몫을 찾는 과정과 동일합니다. 앞의 part 1에서 이미 au, ab를 정수로 만들었으므로 여기에 au, ab를 정수로 만드는 처리를 할 필요가 없습니다.
406
{{{#!if tw=au/bu, tx=bu*tw, ty=bb*tw, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty
407
}}}
408
ty를 정수로 바꾸는 과정을 아래 if 조건문으로 병합합니다.
409
{{{#!if ty=+ty, (tx>au)||((tx==au)&&(ty>ab))
320
}}}}}}{{{#!if au+=(tn-tx), ab-=ty, tn=""
321
}}}}}}{{{#!if !br
322
{{{#!if tw=au/bu, tx=bu*tw, ty=bb*tw, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty, (tx>au)||((tx==au)&&(ty>ab))
410323
{{{#!if tw=(tw==0)?0:tw-1, tx=bu*tw, ty=bb*tw, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty
411
}}}}}}
412
{{{#!if ty>ab
324
}}}}}}{{{#!if ty>ab
413325
{{{#!if au-=1, ab+=+("1"+pd)
414
}}}}}}{{{#!if au-=tx, ab-=ty
415
}}}
416
앞에서 계산된 tz의 값을 tw에 더한 다음 tw를 문자열로 바꿉니다. 그리고 tm에 문자열로 바꾼 tw을 더합니다.
417
{{{#!if tw+=tz, tw=tw.toString(), tm+=tw
418
}}}
419
au와 ab가 모두 0이 될 때 br를 true로 정의합니다.
420
{{{#!if (au==0)&&(ab==0)
326
}}}}}}{{{#!if au-=tx, ab-=ty, tw+=tz, tw=tw.toString(), tm+=tw, (au==0)&&(ab==0)
421327
{{{#!if br=true
422
}}}}}}}}}
423
어느 자릿수부터 br가 true로 되면 이후 자릿수 옮겨 몫을 구하는 과정이나 나머지를 정리하는 과정을 더 이상 할 필요가 없습니다.
424
{{{#!if !br
425
au, ab를 문자열로 다시 바꾸고 처리하는 과정은 동일합니다.
426
{{{#!if au=au.toString(), ab=ab.toString()
427
}}}
428
ps를 au 자릿수가 18이 되었을 때 true가 되는 논리값으로 정의합니다.
429
{{{#!if ps=(au.length==18), tn=ps?au.substr(0,1):"", au=ps?au.substr(1):(pd+au).substr(-17)
430
}}}
431
{{{#!if ab=(ab.length<18)?(pd+ab).substr(-18):ab
432
}}}
433
{{{#!if au+=ab.substr(0,1), ab=ab.substr(1)+"0"
328
}}}}}}}}}{{{#!if !br
329
{{{#!if au=au.toString(), ab=ab.toString(), ps=(au.length==18), tn=ps?au.substr(0,1):"", au=ps?au.substr(1):(pd+au).substr(-17), ab=(ab.length<18)?(pd+ab).substr(-18):ab, au+=ab.substr(0,1), ab=ab.substr(1)+"0"
434330
}}}}}}
435331
##i=2
436
이후부터 과정은 동일합니다. 많아야 소수점 위 36자리, 소수점 아래 36자리 모두를 쓰면 72개이므로 총 72회(for i=0 to i=71)를 진행합니다.
437332
{{{#!if au=+au, ab=+ab, tz=0, !br&&(tn!="")
438333
{{{#!if tn+=pd, tn=+tn, tz=tn/bu, tx=bu*tz, ty=bb*tz, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty, (tx>tn)||((tx==tn)&&(ty>0))
439334
{{{#!if tz=(tz==0)?0:tz-1, tx=bu*tz, ty=bb*tz, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty
440
}}}}}}
441
{{{#!if ty>ab
335
}}}}}}{{{#!if ty>ab
442336
{{{#!if tn-=1, ab+=+("1"+pd)
443337
}}}}}}{{{#!if au+=(tn-tx), ab-=ty, tn=""
444338
}}}}}}{{{#!if !br
445339
{{{#!if tw=au/bu, tx=bu*tw, ty=bb*tw, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty, (tx>au)||((tx==au)&&(ty>ab))
446340
{{{#!if tw-=1, tx=bu*tw, ty=bb*tw, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty,
447
}}}}}}
448
{{{#!if ty>ab
341
}}}}}}{{{#!if ty>ab
449342
{{{#!if au-=1, ab+=+("1"+pd)
450343
}}}}}}{{{#!if au-=tx, ab-=ty, tw+=tz, tw=tw.toString(), tm+=tw, (au==0)&&(ab==0)
451344
{{{#!if br=true
452
}}}}}}}}}
453
{{{#!if !br
345
}}}}}}}}}{{{#!if !br
454346
{{{#!if au=au.toString(), ab=ab.toString(), ps=(au.length==18), tn=ps?au.substr(0,1):"", au=ps?au.substr(1):(pd+au).substr(-17), ab=(ab.length<18)?(pd+ab).substr(-18):ab, au+=ab.substr(0,1), ab=ab.substr(1)+"0"
455347
}}}}}}
456348
##i=3
457349
{{{#!if au=+au, ab=+ab, tz=0, !br&&(tn!="")
458350
{{{#!if tn+=pd, tn=+tn, tz=tn/bu, tx=bu*tz, ty=bb*tz, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty, (tx>tn)||((tx==tn)&&(ty>0))
459351
{{{#!if tz=(tz==0)?0:tz-1, tx=bu*tz, ty=bb*tz, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty
460
}}}}}}
461
{{{#!if ty>ab
352
}}}}}}{{{#!if ty>ab
462353
{{{#!if tn-=1, ab+=+("1"+pd)
463354
}}}}}}{{{#!if au+=(tn-tx), ab-=ty, tn=""
464355
}}}}}}{{{#!if !br
465356
{{{#!if tw=au/bu, tx=bu*tw, ty=bb*tw, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty, (tx>au)||((tx==au)&&(ty>ab))
466357
{{{#!if tw-=1, tx=bu*tw, ty=bb*tw, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty,
467
}}}}}}
468
{{{#!if ty>ab
358
}}}}}}{{{#!if ty>ab
469359
{{{#!if au-=1, ab+=+("1"+pd)
470360
}}}}}}{{{#!if au-=tx, ab-=ty, tw+=tz, tw=tw.toString(), tm+=tw, (au==0)&&(ab==0)
471361
{{{#!if br=true
472
}}}}}}}}}
473
{{{#!if !br
362
}}}}}}}}}{{{#!if !br
474363
{{{#!if au=au.toString(), ab=ab.toString(), ps=(au.length==18), tn=ps?au.substr(0,1):"", au=ps?au.substr(1):(pd+au).substr(-17), ab=(ab.length<18)?(pd+ab).substr(-18):ab, au+=ab.substr(0,1), ab=ab.substr(1)+"0"
475364
}}}}}}
476365
##i=4
477366
{{{#!if au=+au, ab=+ab, tz=0, !br&&(tn!="")
478367
{{{#!if tn+=pd, tn=+tn, tz=tn/bu, tx=bu*tz, ty=bb*tz, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty, (tx>tn)||((tx==tn)&&(ty>0))
479368
{{{#!if tz=(tz==0)?0:tz-1, tx=bu*tz, ty=bb*tz, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty
480
}}}}}}
481
{{{#!if ty>ab
369
}}}}}}{{{#!if ty>ab
482370
{{{#!if tn-=1, ab+=+("1"+pd)
483371
}}}}}}{{{#!if au+=(tn-tx), ab-=ty, tn=""
484372
}}}}}}{{{#!if !br
485373
{{{#!if tw=au/bu, tx=bu*tw, ty=bb*tw, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty, (tx>au)||((tx==au)&&(ty>ab))
486374
{{{#!if tw-=1, tx=bu*tw, ty=bb*tw, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty,
487
}}}}}}
488
{{{#!if ty>ab
375
}}}}}}{{{#!if ty>ab
489376
{{{#!if au-=1, ab+=+("1"+pd)
490377
}}}}}}{{{#!if au-=tx, ab-=ty, tw+=tz, tw=tw.toString(), tm+=tw, (au==0)&&(ab==0)
491378
{{{#!if br=true
492
}}}}}}}}}
493
{{{#!if !br
379
}}}}}}}}}{{{#!if !br
494380
{{{#!if au=au.toString(), ab=ab.toString(), ps=(au.length==18), tn=ps?au.substr(0,1):"", au=ps?au.substr(1):(pd+au).substr(-17), ab=(ab.length<18)?(pd+ab).substr(-18):ab, au+=ab.substr(0,1), ab=ab.substr(1)+"0"
495381
}}}}}}
496382
##i=5
497383
{{{#!if au=+au, ab=+ab, tz=0, !br&&(tn!="")
498384
{{{#!if tn+=pd, tn=+tn, tz=tn/bu, tx=bu*tz, ty=bb*tz, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty, (tx>tn)||((tx==tn)&&(ty>0))
499385
{{{#!if tz=(tz==0)?0:tz-1, tx=bu*tz, ty=bb*tz, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty
500
}}}}}}
501
{{{#!if ty>ab
386
}}}}}}{{{#!if ty>ab
502387
{{{#!if tn-=1, ab+=+("1"+pd)
503388
}}}}}}{{{#!if au+=(tn-tx), ab-=ty, tn=""
504389
}}}}}}{{{#!if !br
505390
{{{#!if tw=au/bu, tx=bu*tw, ty=bb*tw, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty, (tx>au)||((tx==au)&&(ty>ab))
506391
{{{#!if tw-=1, tx=bu*tw, ty=bb*tw, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty,
507
}}}}}}
508
{{{#!if ty>ab
392
}}}}}}{{{#!if ty>ab
509393
{{{#!if au-=1, ab+=+("1"+pd)
510394
}}}}}}{{{#!if au-=tx, ab-=ty, tw+=tz, tw=tw.toString(), tm+=tw, (au==0)&&(ab==0)
511395
{{{#!if br=true
512
}}}}}}}}}
513
{{{#!if !br
396
}}}}}}}}}{{{#!if !br
514397
{{{#!if au=au.toString(), ab=ab.toString(), ps=(au.length==18), tn=ps?au.substr(0,1):"", au=ps?au.substr(1):(pd+au).substr(-17), ab=(ab.length<18)?(pd+ab).substr(-18):ab, au+=ab.substr(0,1), ab=ab.substr(1)+"0"
515398
}}}}}}
516399
##i=6
......
537420
{{{#!if au=+au, ab=+ab, tz=0, !br&&(tn!="")
538421
{{{#!if tn+=pd, tn=+tn, tz=tn/bu, tx=bu*tz, ty=bb*tz, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty, (tx>tn)||((tx==tn)&&(ty>0))
539422
{{{#!if tz=(tz==0)?0:tz-1, tx=bu*tz, ty=bb*tz, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty
540
}}}}}}
541
{{{#!if ty>ab
423
}}}}}}{{{#!if ty>ab
542424
{{{#!if tn-=1, ab+=+("1"+pd)
543425
}}}}}}{{{#!if au+=(tn-tx), ab-=ty, tn=""
544426
}}}}}}{{{#!if !br
545427
{{{#!if tw=au/bu, tx=bu*tw, ty=bb*tw, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty, (tx>au)||((tx==au)&&(ty>ab))
546428
{{{#!if tw-=1, tx=bu*tw, ty=bb*tw, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty,
547
}}}}}}
548
{{{#!if ty>ab
429
}}}}}}{{{#!if ty>ab
549430
{{{#!if au-=1, ab+=+("1"+pd)
550431
}}}}}}{{{#!if au-=tx, ab-=ty, tw+=tz, tw=tw.toString(), tm+=tw, (au==0)&&(ab==0)
551432
{{{#!if br=true
552
}}}}}}}}}
553
{{{#!if !br
433
}}}}}}}}}{{{#!if !br
554434
{{{#!if au=au.toString(), ab=ab.toString(), ps=(au.length==18), tn=ps?au.substr(0,1):"", au=ps?au.substr(1):(pd+au).substr(-17), ab=(ab.length<18)?(pd+ab).substr(-18):ab, au+=ab.substr(0,1), ab=ab.substr(1)+"0"
555435
}}}}}}
556436
##i=8
557437
{{{#!if au=+au, ab=+ab, tz=0, !br&&(tn!="")
558438
{{{#!if tn+=pd, tn=+tn, tz=tn/bu, tx=bu*tz, ty=bb*tz, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty, (tx>tn)||((tx==tn)&&(ty>0))
559439
{{{#!if tz=(tz==0)?0:tz-1, tx=bu*tz, ty=bb*tz, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty
560
}}}}}}
561
{{{#!if ty>ab
440
}}}}}}{{{#!if ty>ab
562441
{{{#!if tn-=1, ab+=+("1"+pd)
563442
}}}}}}{{{#!if au+=(tn-tx), ab-=ty, tn=""
564443
}}}}}}{{{#!if !br
565444
{{{#!if tw=au/bu, tx=bu*tw, ty=bb*tw, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty, (tx>au)||((tx==au)&&(ty>ab))
566445
{{{#!if tw-=1, tx=bu*tw, ty=bb*tw, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty,
567
}}}}}}
568
{{{#!if ty>ab
446
}}}}}}{{{#!if ty>ab
569447
{{{#!if au-=1, ab+=+("1"+pd)
570448
}}}}}}{{{#!if au-=tx, ab-=ty, tw+=tz, tw=tw.toString(), tm+=tw, (au==0)&&(ab==0)
571449
{{{#!if br=true
572
}}}}}}}}}
573
{{{#!if !br
450
}}}}}}}}}{{{#!if !br
574451
{{{#!if au=au.toString(), ab=ab.toString(), ps=(au.length==18), tn=ps?au.substr(0,1):"", au=ps?au.substr(1):(pd+au).substr(-17), ab=(ab.length<18)?(pd+ab).substr(-18):ab, au+=ab.substr(0,1), ab=ab.substr(1)+"0"
575452
}}}}}}
576453
##i=9
577454
{{{#!if au=+au, ab=+ab, tz=0, !br&&(tn!="")
578455
{{{#!if tn+=pd, tn=+tn, tz=tn/bu, tx=bu*tz, ty=bb*tz, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty, (tx>tn)||((tx==tn)&&(ty>0))
579456
{{{#!if tz=(tz==0)?0:tz-1, tx=bu*tz, ty=bb*tz, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty
580
}}}}}}
581
{{{#!if ty>ab
457
}}}}}}{{{#!if ty>ab
582458
{{{#!if tn-=1, ab+=+("1"+pd)
583459
}}}}}}{{{#!if au+=(tn-tx), ab-=ty, tn=""
584460
}}}}}}{{{#!if !br
585461
{{{#!if tw=au/bu, tx=bu*tw, ty=bb*tw, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty, (tx>au)||((tx==au)&&(ty>ab))
586462
{{{#!if tw-=1, tx=bu*tw, ty=bb*tw, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty,
587
}}}}}}
588
{{{#!if ty>ab
463
}}}}}}{{{#!if ty>ab
589464
{{{#!if au-=1, ab+=+("1"+pd)
590465
}}}}}}{{{#!if au-=tx, ab-=ty, tw+=tz, tw=tw.toString(), tm+=tw, (au==0)&&(ab==0)
591466
{{{#!if br=true
592
}}}}}}}}}
593
{{{#!if !br
467
}}}}}}}}}{{{#!if !br
594468
{{{#!if au=au.toString(), ab=ab.toString(), ps=(au.length==18), tn=ps?au.substr(0,1):"", au=ps?au.substr(1):(pd+au).substr(-17), ab=(ab.length<18)?(pd+ab).substr(-18):ab, au+=ab.substr(0,1), ab=ab.substr(1)+"0"
595469
}}}}}}
596470
##i=10
597471
{{{#!if au=+au, ab=+ab, tz=0, !br&&(tn!="")
598472
{{{#!if tn+=pd, tn=+tn, tz=tn/bu, tx=bu*tz, ty=bb*tz, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty, (tx>tn)||((tx==tn)&&(ty>0))
599473
{{{#!if tz=(tz==0)?0:tz-1, tx=bu*tz, ty=bb*tz, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty
600
}}}}}}
601
{{{#!if ty>ab
474
}}}}}}{{{#!if ty>ab
602475
{{{#!if tn-=1, ab+=+("1"+pd)
603476
}}}}}}{{{#!if au+=(tn-tx), ab-=ty, tn=""
604477
}}}}}}{{{#!if !br
605478
{{{#!if tw=au/bu, tx=bu*tw, ty=bb*tw, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty, (tx>au)||((tx==au)&&(ty>ab))
606479
{{{#!if tw-=1, tx=bu*tw, ty=bb*tw, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty,
607
}}}}}}
608
{{{#!if ty>ab
480
}}}}}}{{{#!if ty>ab
609481
{{{#!if au-=1, ab+=+("1"+pd)
610482
}}}}}}{{{#!if au-=tx, ab-=ty, tw+=tz, tw=tw.toString(), tm+=tw, (au==0)&&(ab==0)
611483
{{{#!if br=true
612
}}}}}}}}}
613
{{{#!if !br
484
}}}}}}}}}{{{#!if !br
614485
{{{#!if au=au.toString(), ab=ab.toString(), ps=(au.length==18), tn=ps?au.substr(0,1):"", au=ps?au.substr(1):(pd+au).substr(-17), ab=(ab.length<18)?(pd+ab).substr(-18):ab, au+=ab.substr(0,1), ab=ab.substr(1)+"0"
615486
}}}}}}
616487
##i=11
617488
{{{#!if au=+au, ab=+ab, tz=0, !br&&(tn!="")
618489
{{{#!if tn+=pd, tn=+tn, tz=tn/bu, tx=bu*tz, ty=bb*tz, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty, (tx>tn)||((tx==tn)&&(ty>0))
619490
{{{#!if tz=(tz==0)?0:tz-1, tx=bu*tz, ty=bb*tz, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty
620
}}}}}}
621
{{{#!if ty>ab
491
}}}}}}{{{#!if ty>ab
622492
{{{#!if tn-=1, ab+=+("1"+pd)
623493
}}}}}}{{{#!if au+=(tn-tx), ab-=ty, tn=""
624494
}}}}}}{{{#!if !br
625495
{{{#!if tw=au/bu, tx=bu*tw, ty=bb*tw, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty, (tx>au)||((tx==au)&&(ty>ab))
626496
{{{#!if tw-=1, tx=bu*tw, ty=bb*tw, ty=ty.toString(), ps=(ty.length==19), tx=ps?tx+(+ty.substr(0,1)):tx, ty=ps?ty=ty.substr(1):ty, ty=+ty,
627
}}}}}}
628
{{{#!if ty>ab
497
}}}}}}{{{#!if ty>ab
629498
{{{#!if au-=1, ab+=+("1"+pd)
630499
}}}}}}{{{#!if au-=tx, ab-=ty, tw+=tz, tw=tw.toString(), tm+=tw, (au==0)&&(ab==0)
631500
{{{#!if br=true
632
}}}}}}}}}
633
{{{#!if !br
501
}}}}}}}}}{{{#!if !br
634502
{{{#!if au=au.toString(), ab=ab.toString(), ps=(au.length==18), tn=ps?au.substr(0,1):"", au=ps?au.substr(1):(pd+au).substr(-17), ab=(ab.length<18)?(pd+ab).substr(-18):ab, au+=ab.substr(0,1), ab=ab.substr(1)+"0"
635503
}}}}}}
636504
##i=12
......