#include using namespace std; #define int long long typedef vector vi; typedef pair pi; #define F first #define S second #define PB push_back #define MP make_pair #define popcount __builtin_popcountll const int MOD = 1e9 + 7; void swapp(int &a, int &b) { a = a ^ b; b = a ^ b; a = a ^ b; } int mul(int a, int b) { if (log10l(a) + log10l(b) > 18.3) return 3e18; return a * b; } #define forn(i, a, b) for (int i = a; i < b; i++) bool comp(pair a, pair b) { if (a.first == b.first) { return a.second > b.second; } return a.first < b.first; } void solve() { int ta ; cin >> ta; int a,b,c; cin >> a>> b >> c; int cnt = 0 ; cnt = ta/a + ta/b + ta/c - ta/(a*b) - ta /(a*c) - ta/(b*c) + ta/(a*b*c); cout<> t; while (t--) { solve(); } return 0; }