407189: GYM102697 160 Ken Ken Book

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

160. Ken Ken Booktime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output
This problem is worth 5 points.

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.

Input

The 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.

Output

Output a single integer $$$k$$$: the number of spaces in the puzzle that you have to fill in.

ExamplesInput
4
2
Output
14
Input
6
3
Output
33
Note

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.

加入题单

上一题 下一题 算法标签: