IDENTIFICATION DIVISION.
PROGRAM-ID. IDEONE.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 b PIC X(100) .
01 i PIC 9(3) .
01 du PIC 9(15) VALUE 0.
01 dl PIC 9(16) VALUE 0.
01 d PIC X(31) .
01 m PIC 9(16) VALUE 1000000000000000.
01 c PIC 9 .
01 q PIC 9 .
01 r PIC 9(16) .
PROCEDURE DIVISION.
ACCEPT b
PERFORM VARYING i FROM 1 BY 1 UNTIL i > 100
COMPUTE du = du * 2
COMPUTE dl = dl * 2
MOVE b(i:1) TO c
COMPUTE dl = dl + c
DIVIDE dl BY m GIVING q REMAINDER r
MOVE r TO dl
COMPUTE du = du + q
END-PERFORM.
STRING
du dl
INTO d
END-STRING.
DISPLAY d.
STOP RUN.
CUlERU5USUZJQ0FUSU9OIERJVklTSU9OLgoJUFJPR1JBTS1JRC4gSURFT05FLgogCglFTlZJUk9OTUVOVCBESVZJU0lPTi4KIAoJREFUQSBESVZJU0lPTi4KCVdPUktJTkctU1RPUkFHRSBTRUNUSU9OLgoJMDEgYiBQSUMgWCgxMDApIC4KCTAxIGkgUElDIDkoMykgLgoJMDEgZHUgUElDIDkoMTUpIFZBTFVFIDAuCgkwMSBkbCBQSUMgOSgxNikgVkFMVUUgMC4KCTAxIGQgUElDIFgoMzEpIC4KCTAxIG0gUElDIDkoMTYpIFZBTFVFIDEwMDAwMDAwMDAwMDAwMDAuCgkwMSBjIFBJQyA5IC4KCTAxIHEgUElDIDkgLgoJMDEgciBQSUMgOSgxNikgLgogCglQUk9DRURVUkUgRElWSVNJT04uCgkJQUNDRVBUIGIKCQlQRVJGT1JNIFZBUllJTkcgaSBGUk9NIDEgQlkgMSBVTlRJTCBpID4gMTAwCgkJCUNPTVBVVEUgZHUgPSBkdSAqIDIKCQkJQ09NUFVURSBkbCA9IGRsICogMgoJCQlNT1ZFIGIoaToxKSBUTyBjCgkJCUNPTVBVVEUgZGwgPSBkbCArIGMKCQkJRElWSURFIGRsIEJZIG0gR0lWSU5HIHEgUkVNQUlOREVSIHIKCQkJTU9WRSByIFRPIGRsCgkJCUNPTVBVVEUgZHUgPSBkdSArIHEKCQlFTkQtUEVSRk9STS4KCQlTVFJJTkcKCQkJZHUgZGwKCQkJSU5UTyBkCgkJRU5ELVNUUklORy4KCQlESVNQTEFZIGQuCgkJU1RPUCBSVU4uCiA=