#include<bits/stdc++.h>
using namespace std;
const int N=2e5+10;
int t,n,a[N];
int main(){
scanf("%d",&t);
while(t--){
scanf("%d",&n);for(int i=1;i<=n;i++)scanf("%d",&a[i]);
int ans=0;
for(int i=1;i<=n;i++){
if(a[i]==a[i-1]) continue;
int cnt=0,pos=i;
while(pos<=n){
pos=lower_bound(a+1+pos,a+1+n,2*a[pos]-a[i])-a;
cnt++;
}
ans=max(ans,cnt);
}
cout<<n-ans<<endl;
}
}
相关文章
- 10-03Educational Codeforces Round 17 E. Radio stations cdq分治 + 树状数组
- 10-03Codeforces Global Round 17 简要题解
- 10-03Codeforces Global Round 17
- 10-03Codeforces Global Round 17
- 10-03Codeforces Global Round 17 A-C
- 10-03D. Not Quite Lee(Codeforces Global Round 17)
- 10-03cf Codeforces Global Round 3 E. Earth Wind and Fire
- 10-03[cf] Codeforces Global Round 17 ABC
- 10-03Codeforces Global Round 17 E. AmShZ and G.O.A.T.