#include"testlib.h" #include using namespace std; using LL=long long; using ULL=unsigned long long; #define rep(i,n) for(int i=0; i<(n); i++) const LL result_impossible = -1000000000000; LL sum_N = 0; LL testcase(){ LL N = inf.readInt(2,200000); inf.readSpace(); sum_N+=N; assert(sum_N<=200000); LL A = inf.readInt(0,1000000000); inf.readSpace(); LL W = inf.readInt(0,1000000000); inf.readSpace(); LL K = inf.readInt(1,N); inf.readEoln(); if(A= low_width*diff + (N-1)){ // low+diff <= ans A -= low_width*diff + (N-1); return low+diff + A/K; } if(A >= low_width-1){ // low <= ans < low+diff A-=low_width-1; return min(low + A/low_width, low+diff-1); } // ans < low LL ans=low-(diff+1); ans+=min(diff,A); return ans; } int main(){ registerValidation(); int T = inf.readInt(1,100); inf.readEoln(); rep(t,T){ LL ans=testcase(); if(ans==result_impossible) cout<<":(\n"; else cout<