The MarkiT online virtual market startup wants to organize its grand opening in NIT Patna.
but they want maximum crowd for their inauguration. So the manager told  this  to Praveen a student in NITP who suggested them:
The first-year students come to campus  every x hour,
Second-year students come to campus every y hour,
Third-year students come to campus every z hour and 
Fourth-year is very busy so they don't come regularly.
So Praveen being very clever told him the no of times in n days he can have an audience of all year student (1st,2nd & 3rd) at max. So can you code what Praveen has done?

-----Input:-----
- First line will contain $T$, number of testcases. Then the testcases follow. 
- Each testcase contains of a 2 line of input, first line contain one  integers $N$ (No of Days). 
-Next line contain 3 space separated integer the  value of x y z

-----Output:-----
For each testcase, output in a single line answer the no of times audience consists of all year.

-----Constraints-----
- $1 \leq T \leq 1000$
- $1 \leq N \leq 10^8$
- $1 \leq x,y,z \leq 10^5$

-----Sample Input:-----
1
10
8 10 6

-----Sample Output:-----
2

-----EXPLANATION:-----
First favourable condition will come on 5th day and Second on 10th day.

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = 'def find_lcm(num1, num2): \n if(num1>num2): \n  num = num1 \n  den = num2 \n else: \n  num = num2 \n  den = num1 \n rem = num % den \n while(rem != 0): \n  num = den \n  den = rem \n  rem = num % den \n gcd = den \n lcm = int(int(num1 * num2)/int(gcd)) \n return lcm\n \ndef crowd(days,x,y,z):\n hrs=days*24\n abc=find_lcm(x,y)\n abc=find_lcm(abc,z)\n return hrs//abc\n\nt=int(input())\nnodays=[]\na=[]\nb=[]\nc=[]\nfor i in range(t):\n nodays.append(int(input()))\n d,e,f=map(int,input().split())\n a.append(d)\n b.append(e)\n c.append(f)\nfor i in range(t):\n print(crowd(nodays[i],a[i],b[i],c[i]))'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 13561