diff --git a/solutions/punched_cards/.DS_Store b/solutions/punched_cards/.DS_Store new file mode 100644 index 00000000..d5ac2e94 Binary files /dev/null and b/solutions/punched_cards/.DS_Store differ diff --git a/solutions/punched_cards/punched_cardss.js b/solutions/punched_cards/punched_cardss.js new file mode 100644 index 00000000..f339c6f8 --- /dev/null +++ b/solutions/punched_cards/punched_cardss.js @@ -0,0 +1,77 @@ +'use strict'; + +process.stdin.resume(); +process.stdin.setEncoding('utf-8'); + +let inputString = ''; +let currentLine = 0; + +process.stdin.on('data', inputStdin => { + inputString += inputStdin; +}); + +process.stdin.on('end', _ => { + inputString = inputString.trim().split('\n').map(string => { + return string.trim(); + }); + + main(); +}); + +function readline() { + return inputString[currentLine++]; +} + +// Make a Snippet for the code above this and then write your logic in main(); + +const draw = (row, col) => { + let rowN = ''; + for (let r=0; r parseInt(x)); + row = (row*2) +1; + col = (col*2) +1; + + // Compute the value of the sum modulo M. + let drawing = draw(row, col); + + // Print the result onto the standard output. + process.stdout.write(drawing); +} + +function main() { + // Declare and read the number of test cases. + var T; + T = parseInt(readline()); + + // Loop over the number of test cases. + for (var test_no = 1; test_no <= T; test_no++) { + process.stdout.write('Case #' + test_no + ': \n'); + solve(); + } +} +