F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Calculus

Time 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
2 1sinx+0cosx+3x+6/sinx 0
 

Sample Output
NO YES
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2025 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.001000(s) query 1, Server time : 2025-04-01 06:59:48, Gzip enabled