#include "iostream" #define ll long long int main(){ int t; scanf("%d",&t); while (t--){ ll a[100005]; ll w[100005]; int n; int pos; ll ans = 0x3f3f3f3f3f3f3f3f; scanf("%d",&n); for(int i=1;i&...