Selecting Majors
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

City University of Hong Kong (Dongguan) implements a broad training model. Students do not directly select majors at the beginning of enrollment, and choose majors in the first year, and can freely choose among the four majors offered, which are Intelligent Manufacturing Engineering, Computer Science, Materials Science and Energy Engineering.

City University of Hong Kong (Dongguan) is considering to calculate how many classrooms will be required, so they've just surveyed on undergraduate students' preferred majors, which shows that a students will prefer Intelligent Manufacturing Engineering, b students will prefer Computer Science, c students will prefer Materials Science, and d students will prefer Energy Engineering.

City University of Hong Kong (Dongguan) adopts small-sized classes, so each classroom should meet the following requirements:

  1. Capacity of Each classroom is limited to 30 students.
  2. Each classroom is only available for students who prefer the same major.

So, how many classrooms will City University of Hong Kong (Dongguan) use to contain all undergraduate students?

输入描述:

The first line contains a single integer T (1 \leq T \leq 10^4) — the number of test cases.

The first line of each test case contains four integers a,b,c and d (1 \leq a,b,c,d \leq 1 \cdot 10^9) —representing the number of students who prefer Intelligent Manufacturing EngineeringComputer ScienceMaterials Science and Energy Engineering, respectively.

输出描述:

For each test case, please print a single integer in a single line which means how many classrooms are required in total to contain all students.
示例1

输入

复制
3
120 0 0 0
30 30 29 31
120 119 121 0

输出

复制
4
5
13

说明

As for the first test case, four classrooms are there for Computer Science students with each contains 30 students.
As for the second test case, energe engineering major will have two classrooms——one to be full, while the other one contains only one student.