#include using namespace std; #define REP(i,a,b) for(i=a;i ind[100000]; int main(){ int i, j, tmp; int s, t; int res; scanf("%d%d%d",&N,&M,&K); rep(i,N) scanf("%d",A+i); rep(i,N) A[i]--; b_len = 100; b_num = (N + b_len - 1) / b_len; for(i=0;i=t;i--){ j = lower_bound(ind[A[i]].begin(), ind[A[i]].end(), L) - ind[A[i]].begin(); if(j==ind[A[i]].size()) continue; res = max(res, i - ind[A[i]][j]); } printf("%d\n", res); } return 0; }