1254: An easy problem

时间限制: C/C++ 1 s      Java/Python 3 s      内存限制: 128 MB      答案正确: 39 / 56     

题目描述

We define f(A)=1,f(a)=-1,f(B)=2,f(b)=-2, ... f(Z)=26,f(z)=-26; 
Give you a letter x and a number y , you should output the result of f(x)+y.

输入

On the first line, contains a number n.

Then n lines follow, each line is a case.
Each case contains a letter and a number.

输出

For each case, you should the result of   f(x)+y  on a line.

样例输入

6
R 1
P 2
G 3
r 1
p 2
g 3

样例输出

19
18
10
-17
-14
-4

提示

来源

标签


提交代码






© 2019 JustOJ     中文  English  | l.jiang.1024@gmail.com | Docs | System Info | Telegram Group | Telegram Channel