EC_WORLD  Rotations
Given a string S over the alphabet [az], the 'cyclic rotation' that chain is obtained by removing one or more characters from the beginning of the string and place them in the same order at the end of this. Eg. if S = 'abcd' some of its cyclic rotations are 'bcda' and 'dabc'. Given two strings P and Q, both of the same length, decide whether Q is a cyclic rotation of P.
Input
The first line contains an integer T, which represents the number of cases to solve. Each case consists of two lines, the first containing the string P and the second line contains the string Q.
T <= 100
length P <= 100000
For each case should print 'Si' (without quotes) if the string Q is a cyclic rotation of P, and 'No' otherwise.
Example
Input:2
abc
cab
aabb
abab
Output:Si
No
hide comments
Sandip Jana:
20150628 13:07:29
Learned a new Thing in JAVA..Thanks To Problem Setter 

Eddy Cael:
20140911 02:08:39
I am sorry for wrong constraint. Somebody from Spoj's EB change my problem statement. Lenght p <= 10^5. 

Bhavik:
20140911 02:08:39
@Eddy Cael: Can you kindly tell why my code id:12304418 gives internal error!!


LeppyR64:
20140911 02:08:39
Confirmed 100%. There is a test case with P == 100000. All test cases have P <= 100000. 

wisfaq:
20140911 02:08:39
please remove unnecesary language restrictions. 

RIVU DAS:
20140911 02:08:39
I request the problem setter to change the constraints ASAP! 

mehmetin:
20140911 02:08:39
length P is greater than 10000 in the input, I guess it is 100000 maximum. Last edit: 20140901 09:38:24 
Added by:  Eddy Cael 
Date:  20140831 
Time limit:  1s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  C CSHARP C++ 4.3.2 CPP JAVA PASFPC PYTHON RUBY 
Resource:  Internas UTO 2014 