-
Notifications
You must be signed in to change notification settings - Fork 2
/
a.cpp
37 lines (33 loc) · 717 Bytes
/
a.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
#include <bits/stdc++.h>
#define endl '\n'
#define eat cin
#define moo cout
#define int long long
using namespace std;
int T, N, a[100];
int32_t main(){
eat.tie(0) -> sync_with_stdio(0);
eat >> T;
while(T--){
eat >> N;
int g, mx, mn;
eat >> g;
mx = g;
mn = g;
for(int i = 1; i < N; i++){
int x; eat >> x;
mx = max(mx, x);
mn = min(mn, x);
}
if(mn < 0){
moo << "nO" << endl;
}else{
moo << "yeS" << endl;
moo << mx+1 << endl;
for(int i = 0; i <= mx; i++){
moo << i << " ";
}
moo << endl;
}
}
}