Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let input = ['3',
- '2'
- ];
- let print = this.print || console.log;
- let gets = this.gets || ((arr, index) => () => arr[index++])(input, 0);
- var N = +gets();
- var X = +gets();
- var sum = 1;
- var y = 1;
- for(var i = 1; i <= N; i++){
- y *= i;
- sum += y/Math.pow(X,i);
- }
- print(sum.toFixed(5))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement