Cut the Rope is a series of physics-based puzzle video games developed by the Russian entertainment company ZeptoLab for several platforms and devices. It consists of the original Cut the Rope (2010) published by Chillingo, Cut the Rope: Experiments (2011), Cut the Rope: Time Travel (2013), Cut the Rope 2 (2013 iOS; 2014 Android), My Om Nom (2014 iOS; 2015 Android), and Cut the Rope: Magic (2015).
The objective of the Cut the Rope games is to feed candy to a little green creature named Om Nom while collecting stars. As of May 2015, Cut the Rope games have been downloaded more than 600 million times.
Now you have a very long rope to cut. The length of rope is L. And here are some rules to follow:
• After the cutting, the number of the ropes is maximum.
• After the cutting, the length of every piece of the rope must be a, b, or c.
The first line contains an integer T (T ≤ 100), which indicates the number of test cases. For each case, one line contains 4 integers L, a, b, c (1 ≤ L, a, b, c ≤ 4000).
For each case, output one line containing the maximum of the number of the pieces.