#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define all(a) (a).begin(), (a).end()
#define NAME "bai1"
const int maxn = 1e6+1;
const int NTEST = 100;
ll Rand(ll l, ll r){
return l+rand() * 1LL * rand() % (r+l-1);
}
void MakeTest(){
ofstream inp(NAME".inp");
int n = Rand(5, 1000);
inp<<n;
for(int i=1;i<=n;++i){
inp<<Rand(1,1e6)<<' ';
}
}
int main()
{
srand(time(0));
for(int i=1;i<=NTEST;++i){
MakeTest();
system(NAME"_trau.exe");
system(NAME".exe");
if(system("fc "NAME".ans "NAME".out") != 0){
cout<<"TEST "<<i<<": Wrong!\n";
return 0;
}
cout<<"TEST "<<i<<": Correct!\n";
}
return 0;
}
/*---------------END---------------*/
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKI2RlZmluZSBsbCBsb25nIGxvbmcKI2RlZmluZSB1bGwgdW5zaWduZWQgbG9uZyBsb25nCiNkZWZpbmUgYWxsKGEpIChhKS5iZWdpbigpLCAoYSkuZW5kKCkKI2RlZmluZSBOQU1FICJiYWkxIgpjb25zdCBpbnQgbWF4biA9IDFlNisxOwpjb25zdCBpbnQgTlRFU1QgPSAxMDA7CmxsIFJhbmQobGwgbCwgbGwgcil7CglyZXR1cm4gbCtyYW5kKCkgKiAxTEwgKiByYW5kKCkgJSAocitsLTEpOwp9CnZvaWQgTWFrZVRlc3QoKXsKCW9mc3RyZWFtIGlucChOQU1FIi5pbnAiKTsKCWludCBuID0gUmFuZCg1LCAxMDAwKTsKCWlucDw8bjsKCWZvcihpbnQgaT0xO2k8PW47KytpKXsKCQlpbnA8PFJhbmQoMSwxZTYpPDwnICc7Cgl9Cn0KaW50IG1haW4oKQp7CglzcmFuZCh0aW1lKDApKTsKCWZvcihpbnQgaT0xO2k8PU5URVNUOysraSl7CgkJTWFrZVRlc3QoKTsKCQlzeXN0ZW0oTkFNRSJfdHJhdS5leGUiKTsKCQlzeXN0ZW0oTkFNRSIuZXhlIik7CgkJaWYoc3lzdGVtKCJmYyAiTkFNRSIuYW5zICJOQU1FIi5vdXQiKSAhPSAwKXsKCQkJY291dDw8IlRFU1QgIjw8aTw8IjogV3JvbmchXG4iOwoJCQlyZXR1cm4gMDsKCQl9CgkJY291dDw8IlRFU1QgIjw8aTw8IjogQ29ycmVjdCFcbiI7Cgl9CgoJcmV0dXJuIDA7Cgp9Ci8qLS0tLS0tLS0tLS0tLS0tRU5ELS0tLS0tLS0tLS0tLS0tKi8KCg==