package test;
import java.util.Scanner;
public class Main {
private static Scanner sc;
public static void main(String[] args) {
sc = new Scanner(System.in);
int line = sc.nextInt();
while (line-- > 0) {
int x = sc.nextInt();
int y = sc.nextInt();
if (x == y) {
if (x % 2 == 0) {
System.out.println(2 * x);
} else {
System.out.println(2 * (x - 1) + 1);
}
} else if (x - y == 2) {
if (x % 2 == 0) {
System.out.println(2 * x - 2);
} else {
System.out.println(2 * (x - 1) - 1);
}
} else {
System.out.println("No Number");
}
}
}
}
HDOJ 1391 Number Steps
最新推荐文章于 2019-07-11 16:54:34 发布