import java.util.Scanner;
class Main {
public static void main(String[] args){
Scanner input = new Scanner(System.in);
int a=input.nextInt();
for(int i=1;i<=a;i++){
int b,c,d,e,f;
b=input.nextInt();
c=input.nextInt();
if(c>b)
{
d=((c-b)*4);
e=(b*4);
f=d+e+19;
}
else if(c<b)
{
d=((b-c)*4);
e=(b*4);
f=d+e+19;
}
else
{
d=(c*4);
f=d+19;
}
System.out.println("Case "+i+": "+f);
}
}
}
0 comments:
Post a Comment