#include #define ll long long using namespace std; int main(){ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); ll n,m; cin>>n>>m; ll l[n+5],f[m+5],b[m+5],w[m+5]; l[0]=-1000000005; l[n+1]=1000000005; for(ll i=1;i<=n;i++)cin>>l[i]; for(ll i=1;i<=m;i++)cin>>f[i]>>b[i]>>w[i]; ll ans=0; for(ll i=1;i<=m;i++){ ll left=1,right=n,mid=(left+right)/2,mn=abs(l[mid]-f[i]); while(left