Simple Math Problem
1000ms 131072K
描述:
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
输入:
Only a single line contains three integers n,x,y(0≤x≤1000000000,0≤y≤1000000000,1≤n≤1000000001)n,x,y(0≤x≤1000000000,0≤y≤1000000000,1≤n≤1000000001)
输出:
A single line with an integer representing the corresponding value.
样例输入:
5 2 2
样例输出:
12
1月18:
描述:
童童再一次玩起来数学游戏,她已经有很多次遇到这个方阵,所以不用说,她知道你想要说什么。现在,她把这个问题给你,你需要看如下的方阵,然后她将会给你三个整数n,x,和y,这意味着这里有一个n*n的方阵。
你需要想出行x,列y对应的什么值。
比如,这里有一个5*5的方阵:
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
输入:
只有单独的一行包括了三个整数n,x,y(0<=x<=1000000000,0<=y<1000000000,1<=1000000001)
输出:
有着一个整数代表对应值的单独的一行