Simple Math Problem
题号:NC213990
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 128 M,其他语言256 M
64bit IO Format: %lld

题目描述

Tongtong is playing math game again. She had come across this square matrix many times,so needless to say, she knows what you want to ask. Now she throws this question to you. You need to look at the following square matrix,then she will give you three integers n,x,and y,that means there are an n×n square matrix.

You need to figure out what the value of row x, column y corresponds to.

For example,there are one 5×5 square matrix:

0   1   3   6   A

2   4   7   B   F

5   8   C  10  13

9   D  11  14  16

E  12  15  17  18

Letters stand for hexadecimal numbers

输入描述:

Only a single line contains three integers n,x,y (0≤x≤1000000000, 0≤y≤1000000000, 1≤n≤1000000001)

输出描述:

A single line with an integer representing the corresponding value.

示例1

输入

复制
5  2  2

输出

复制
12