aboutsummaryrefslogtreecommitdiff
path: root/challenge-134/abigail/node/ch-2.js
blob: ae1d561c97f4aa1a2aa10727db527576e27e0a28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/local/bin/node

//
// See ../README.md
//

//
// Run as: node ch-2.js < input-file
//

  require ('readline')
. createInterface ({input: process . stdin})   
. on              ('line', line => {
    let [n, m] = line . trim () . split (" ") . map (x => +x)
    let seen = {}
    for (let i = 1; i <= n; i ++) {
        for (let j = 1; j <= m; j ++) {
            seen [i * j] = 1
        }
    }
    console . log (Object . keys (seen) . length)
})