![]() |
||||||||||
|
||||||||||
CalculusTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 726 Accepted Submission(s): 350 Problem Description This summer, ZXyang became so tired when doing the problems of Multi-University contests. So he decided to attend the Unified National Graduate Entrance Examination. This day, he sees a problem of series. Let $S(x)$ be a function with $x$ as the independent variable. $S(x)$ can be represented by the formula as follow. $$f(x)=\sum_{i=1}^n f_i(x)$$ $$S(x)=\sum_{j=1}^xf(j)$$ $f_i(x)$ is a function with $x$ as the independent variable. Furthermore. $f_i(x)$ belongs to the function set $F$. $$ F=\left \{ C, \frac{C}{x}, C\sin x, C\cos x, \frac{C}{\sin x}, \frac{C}{\cos x}, Cx, C^x \right \} $$ $C$ is a constant integer ranging from $0$ to $10^9$. ZXyang wonders if $S(x)$ is convergent. $S(x)$ is convergent if and only if $ \lim\limits_{x\to \infty}S(x)=c$, where $c$ is a constant. Input The first line of input contains a single integer $t\ (1\leq t\leq 10^4)$ --- the number of test cases. The first and the only line of each test case contains a single string $s\ (1\leq |s|\leq 100)$, indicating the formula of $f(x)$. Fraction is presented as $\text{a/b}$. $C^x$ is presented as $\text{C^x}$. It's guaranteed that the constant $C$ won't be left out when $C=1$. $f(x)$ consists of functions from $F$ connected with $+$. Output For each test case, print $\text{YES}$ in one line if $S(x)$ is a convergent sequence, or print $\text{NO}$ in one line if not. Sample Input
Sample Output
Source | ||||||||||
|