Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Auto-generated code below aims at helping you parse
- * the standard input according to the problem statement.
- **/
- var inputs = readline().split(' ');
- M = parseInt(inputs[0]);
- D = parseInt(inputs[1]);
- N = parseInt(inputs[2]);
- t = []
- while(N>0)
- {
- t.push(M);
- M = D+M;
- N--;
- }
- console.log(t.reduce((a,b)=>a+b));
- //
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement