#include using namespace std; int main(){ int T; cin >> T; for (int i = 0; i < T; i++){ int N, A, W, K; cin >> N >> A >> W >> K; if (K != N || W == 0){ if (A < K - 1){ cout << ":(" << endl; } else if (A % K == K - 1){ cout << A / K << endl; } else { cout << A / K - 1 << endl; } } else { long long sum = A - (long long) W * (W + 1) / 2; int r = (sum % N + N) % N; long long q = (sum - r) / N; if (r == N - 1){ cout << q << endl; } else { cout << q - 1 << endl; } } } }