-
Notifications
You must be signed in to change notification settings - Fork 2
/
1107A.cpp
64 lines (56 loc) · 1.54 KB
/
1107A.cpp
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// Author : Mars_Coder
#define _USE_MATH_DEFINES
#include<bits/stdc++.h>
using namespace std;
#define ln "\n" // no flush, oppos of endl
#define _flush endl
#define stop_sync ios::sync_with_stdio(false) // not to use c-stye io
#define untie_ios cin.tie(nullptr) // no flush
#define lli long long int
#define vi vector<int>
#define vii vector<lli>
#define vss vector<string>
#define pb push_back
#define ppb pop_back
#define sz(x) ((x).size())
#define all(x) (x).begin(), (x).end()
#define bin_sc(a, x) binary_search(all(a), x)
#define lbd(a, x) lower_bound(all(a), x) // an iter.
#define ubd(a, x) upper_bound(all(a), x) // an iter.
#define eq_seg(a, x) equal_range(all(a), x) // a pair of lb, ub
#define FIXED(x) cout << fixed << setprecision(x)
const long double PI = acos(-1.0L);
int main(void){
#ifndef ONLINE_JUDGE
//freopen("generator.txt", "r", stdin);
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
freopen("error.txt", "w", stderr);
#endif
int q;
cin >> q;
while(q--){
int n;
cin >> n;
string s;
cin >> s;
if(n == 2){
if(s[0] >= s[1]){
cout << "NO\n";
continue;
}
}
cout << "YES\n";
cout << 2 << ln;
cout << s[0] << ' ';
for(int i = 1; i < n; ++i) cout << s[i];
cout << ln;
}
return 0;
}
/*
some familiar issues:
!----> [look at global variables and their values]
!----> [llabs() for long long int type]
!----> [look at input size]
*/