7 kyu
Simple Fun #13: Magical Well
562 of 1,527myjinxin2015
Description:
Task
You are standing at a magical well. It has two positive integers written on it: a
and b
. Each time you cast a magic marble into the well, it gives you a * b
dollars and then both a
and b
increase by 1. You have n
magic marbles. How much money will you make?
Example
For a = 1, b = 2 and n = 2, the output should be 8
You will cast your first marble and get $2, after which the numbers will become 2 and 3. When you cast your second marble, the well will give you $6. Overall, you'll make $8. So, the output is 8.
Input/Output
[input]
integera
Constraints:
1 ≤ a ≤ 2000
[input]
integerb
Constraints:
1 ≤ b ≤ 2000
[input]
integern
The number of magic marbles in your possession, a non-negative integer.
Constraints:
0 ≤ n ≤ 5
[output]
an integer
Puzzles
Similar Kata:
Stats:
Created | Jan 22, 2017 |
Published | Jan 22, 2017 |
Warriors Trained | 1904 |
Total Skips | 16 |
Total Code Submissions | 2924 |
Total Times Completed | 1527 |
JavaScript Completions | 562 |
PHP Completions | 164 |
CoffeeScript Completions | 13 |
C# Completions | 159 |
Python Completions | 638 |
Ruby Completions | 97 |
Julia Completions | 10 |
Total Stars | 14 |
% of votes with a positive feedback rating | 95% of 367 |
Total "Very Satisfied" Votes | 332 |
Total "Somewhat Satisfied" Votes | 31 |
Total "Not Satisfied" Votes | 4 |
Total Rank Assessments | 13 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 8 kyu |