#C. [GESP202403 四级] 相似字符串

    Type: RemoteJudge 1000ms 512MiB

[GESP202403 四级] 相似字符串

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目描述

对于两个字符串 AABB,如果 AA 可以通过删除一个字符,插入一个字符,修改一个字符变成 BB,那么我们说 AABB 是相似的。

比如 apple\texttt{apple} 可以通过插入一个字符变成 applee\texttt{applee},可以通过删除一个字符变成 appe\texttt{appe},也可以通过修改一个字符变成 bpple\texttt{bpple}。因此 apple\texttt{apple}applee\texttt{applee}appe\texttt{appe}bpple\texttt{bpple} 都是相似的。但 applee\texttt{applee} 并不能 通过任意一个操作变成 bpple\texttt{bpple},因此它们并不相似。

特别地,两个完全相同的字符串也是相似的。

给定 TTA,BA,B,请你分别判断它们是否相似。

输入格式

第一行一个正整数 TT
接下来 TT 行,每行两个用空格隔开的字符串 AABB

输出格式

对组 A,BA,B,如果他们相似,输出 similar,否则输出 not similar

5
apple applee
apple appe
apple bpple
applee bpple
apple apple
similar
similar
similar
not similar
similar

提示

对全部的测试数据,保证 1T1001 \leq T \leq 100AABB 的长度不超过 5050,仅含小写字母。