3380 - Another Easy String Problem 3380 - Otro Problema Fácil Sobre Cadenas 3380 - Another Easy String Problem

Statistics Sub: 878 | AC: 193 | AC%: 21,98 | Score: 0,92
Created by Luis Enrique Garcia Marrero
Added by legar (2015-09-30)
Limits
Total Time: 2500 MS | Test Time: 1000 MS |Memory: 256 MB | Output: 64 MB | Size: 16 KB
Enabled languages
Available in

Description

A string S is known, and is allowed to make some changes on it. In our string is allowed to exchange the characters in position i with the position L-i-1 for a 0-base indexed string S of length L. Now is given another string P and you must create a program that given strings S and P, print when you can get P through some changes or perhaps none, that are allowed to the string S.

;jsessionid=1A15CF18696C6DB1888768B4CEA4A347
Una cadena de caracteres S es conocida, y está permitido realizar algunos cambios sobre esta. En nuestra cadena se puede intercambiar el caracter en la posición i con el caracter en la posición L-i-1 siendo cero la posición del primer caracter y L el tamaño de la cadena. Ahora conocemos a otra cadena de caracteres P y usted debe crear un programa que conocidas las cadenas S y P imprima cuando se puede obtener P haciendo algunos cambios permitidos, o quizás ninguno, sobre la cadena S.

A string S is known, and is allowed to make some changes on it. In our string is allowed to exchange the characters in position i with the position L-i-1 for a 0-base indexed string S of length L. Now is given another string P and you must create a program that given strings S and P, print when you can get P through some changes or perhaps none, that are allowed to the string S.

;jsessionid=1A15CF18696C6DB1888768B4CEA4A347

Input specification

The first line of input contains an integer 1 <= T <= 10^3 denoting the number of test cases. T lines follow each one containing two string, S and P separated by a blank space. The strings will be composed only of lowercase characters of the English alfabet. 1 <= |S|, |P| <= 10^3.
;jsessionid=1A15CF18696C6DB1888768B4CEA4A347
La primera linea de entrada contiene un entero 1 <= T <= 10^3, indicando la cantidad de casos. T líneas le seguirán cada una conteniendo dos cadenas de caracteres, S y P, separadas por un espacio en blanco. Las cadenas estarán compuestas solamente por caracteres del alfabeto Inglés todas en minúscula. 1 <= |S|,|P| <= 10^3.
The first line of input contains an integer 1 <= T <= 10^3 denoting the number of test cases. T lines follow each one containing two string, S and P separated by a blank space. The strings will be composed only of lowercase characters of the English alfabet. 1 <= |S|, |P| <= 10^3.
;jsessionid=1A15CF18696C6DB1888768B4CEA4A347

Output specification

For each case output a line with string "YES" if you can get P through some changes or perhaps none, that are allowed to the string S. If it is impossible to get P then prints string "NO".
;jsessionid=1A15CF18696C6DB1888768B4CEA4A347
Para cada caso imprima una linea con la palabra "YES" si se puede obtener P haciendo algunos cambios permitidos, o quizás ninguno, sobre la cadena S. Si es imposible obtener P entonces imprima la palabra "NO".
The first line of input contains an integer 1 <= T <= 10^3 denoting the number of test cases. T lines follow each one containing two string, S and P separated by a blank space. The strings will be composed only of lowercase characters of the English alfabet. 1 <= |S|, |P| <= 10^3.
;jsessionid=1A15CF18696C6DB1888768B4CEA4A347

Sample input

2
acd dca
abcde edfba

Sample output

YES
NO

Hint(s)

http://coj.uci.cu/24h/
http://coj.uci.cu/24h/
http://coj.uci.cu/24h/

Recommendation

We have carefully selected several similar problems: 1721 | 3166 | 3375 | 2623 | 3667 | 4001