aboutsummaryrefslogtreecommitdiff
path: root/contests/08-03-2022(Div.3)/A.cpp
blob: 741b57a7fc0685ee1c806466ea7df03011c9b9f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include<bits/stdc++.h>

using namespace std;

int main(){
    int tt;
    cin >> tt;
    while(tt--){
        string word;
        char ch;
        cin >> word;
        cin >> ch;
        int len = word.length();
        if(word[len/2 + 1] == ch){
            cout << word[len/2 + 1] << endl;
            cout << ch << endl;
            cout << "YES" << "\n";
        }
        else{
            cout << "NO" << "\n";
        }
    }

    return 0;
}