#include// <3 Nandini <3 using namespace std; #define gc getchar #define mp make_pair #define pb push_back #define sc scanint #define dc print_int #define f first #define s second #define ret return 0; #define rf std::ios::sync_with_stdio(false); #define mi 1000000007 #define tl int t;sc(t);while(t--) #define in int n;sc(n); #define vin vi arr; for(int i=0;i>ws,s1); #define sorta sort(arr.begin(),arr.end()); #define reva reverse(arr.begin(),arr.end()); #define pf(a) printf("%d",a); #define mina *min_element(arr.begin(),arr.end()) #define maxa *max_element(arr.begin(),arr.end()) #define sl scanlong typedef vector vi; typedef vector > vii; typedef long long int ll; typedef pair pii; typedef unsigned long long int ull; void scanint(int &x) { register int c = gc(); x = 0; int neg = 0; for(;((c<48 || c>57) && c != '-');c = gc()); if(c=='-') {neg=1;c=gc();} for(;c>47 && c<58;c = gc()) {x = (x<<1) + (x<<3) + c - 48;} if(neg) x=-x; } void scanlong(ull &x); void scanlong(ull &x) { int flag=0; register int c = gc(); if(c == '-') flag=1; x = 0; for(;(c<48 || c>57);c = gc()); for(;c>47 && c<58;c = gc()) {x = (x<<1) + (x<<3) + c - 48;} if(flag == 1)x=-x; } int lis( int arr[], int n ) { int *lis, i, j, max = 0; lis = (int*) malloc ( sizeof( int ) * n ); /* Initialize LIS values for all indexes */ for (i = 0; i < n; i++ ) lis[i] = 1; /* Compute optimized LIS values in bottom up manner */ for (i = 1; i < n; i++ ) for (j = 0; j < i; j++ ) if ( (arr[i] == (arr[j]-1)) && lis[i] < lis[j] + 1) lis[i] = lis[j] + 1; /* Pick maximum of all LIS values */ for (i = 0; i < n; i++ ) if (max < lis[i]) max = lis[i]; /* Free memory to avoid memory leak */ free(lis); return max; } int main() { in vin sorta vi arr1; int count =1; for(int i=0;i