CF1519B The Cake Is a Lie

题目描述

有一个 $n\times m$ 的矩阵,初始时你站在 $(1,1)$ ,终点在 $(n,m)$。 当你站在 $(x,y)$ 时,你可以: - 走向 $(x,y+1)$,获得 $x$ 点分数; - 走向 $(x+1,y)$,获得 $y$ 点分数。 请问你是否可以在走到终点时**恰好获得** $k$ 点分数。

输入格式

第一行有一个正整数 $t$ ( $1\le t\le 100$ ),表示询问组数。

输出格式

对于每组询问,若满足要求则输出 `YES`,否则输出 `NO`。 Translated by Rosmarinus.

说明/提示

In the first test case, you are already in the final cell, so you spend $ 0 $ burles. In the second, third and fourth test cases, there are two paths from $ (1, 1) $ to $ (2, 2) $ : $ (1, 1) $ $ \rightarrow $ $ (1, 2) $ $ \rightarrow $ $ (2, 2) $ or $ (1, 1) $ $ \rightarrow $ $ (2, 1) $ $ \rightarrow $ $ (2, 2) $ . Both costs $ 1 + 2 = 3 $ burles, so it's the only amount of money you can spend. In the fifth test case, there is the only way from $ (1, 1) $ to $ (1, 4) $ and it costs $ 1 + 1 + 1 = 3 $ burles.