407189: GYM102697 160 Ken Ken Book
Description
Ken Ken is a number puzzle created in 2004 by Tetsuya Miyamoto.
You're solving Ken Ken puzzles from a puzzle book. Each puzzle is an $$$n$$$ by $$$n$$$ grid, and you have to fill in all of the spaces in the grid.
There are also $$$k$$$ "freebie" spaces, which have already been filled in.
Given $$$n$$$, the size of the grid, figure out how many total spaces you have to fill in. For example, to solve a 4 by 4 puzzle with two freebies, you would have to fill in 14 spaces.
InputThe first line of input consists of a single positive integer $$$n$$$: the size of the puzzle, indicating that the puzzle is an $$$n$$$ by $$$n$$$ grid.
The second line of input consists of a single positive integer $$$k$$$: the number of freebie spaces in the grid that have already been filled in.
OutputOutput a single integer $$$k$$$: the number of spaces in the puzzle that you have to fill in.
ExamplesInput4 2Output
14Input
6 3Output
33Note
If you like Ken Ken, you should look at the hardest problem in this contest, which asks you to write a program to solve a Ken Ken puzzle.