An easy problem
#include <stdio.h>
#include <string.h>
int
main()
{
int
y,n,sum;
char
x;
while
(
scanf
(
"%d"
,&n)!=EOF)
{
while
(n--)
{
getchar
();
scanf
(
"%c %d"
,&x,&y);
if
(x>=
'A'
&&x<=
'Z'
)
sum=x+y-
'A'
+1;
else
sum=-(x-
'a'
+1)+y;
printf
(
"%d\n"
,sum);
}
}
return
0;
}