U547992 【LAR-1】Finite and Infinite

题目背景

[//]: # (vjudge-owner:#991849) What is finite? What is infinite? No one knew the answer...

题目描述

There $n$ integers $a_1,a_2,\dots,a_n$. The first $m$ integers $a_1,a_2,\dots,a_m$ are given. The rest $n-m$ integers are constructed. For each $m

输入格式

The first line contains two integers $n$ and $m$. The second line contains $m$ integers $a_1,a_2,\dots,a_m$. Then there are $n-m$ lines. The $i$-th line contains a character $c$ and two integers $j,k$ for the construction method for $a_{i+m}$. $c$ is one of `+`, `-`, `*` or `/`, representing the construction method ($a_j+a_k$, $a_j-a_k$, $a_ja_k$ or $\dfrac{a_j}{a_k}$).

输出格式

Print $n-m$ lines. The $i$-th line should contain a string of three characters, either `inf` or `fin`. `inf` means that $a_{i+m}$ is infinite, while `fin` means that $a_{i+m}$ is finite.

说明/提示

### Sample Explanation $a_3=a_1a_2=1\cdot0=0$ is finite. $a_4=\dfrac{a_2}{a_3}=\dfrac00=\infty$ is infinite. ### Constraints - $1\le m\le n\le10^5$. - $a_i\in[-10^9,10^9]\cup\color{red}\{\infty\}$ for every $1\le i\le n\color{red}+m$. - $1\le j,k