SOLVE

LATER

Prof. H.Pole and his Strict Classes

Problem

Editorial

Analytics

Prof. H.Pole takes classes every day from 9 to 10 AM . The Class is divided into 4 Catogories of Students .

1) The 9 Pointers , who arrives class between 8:01AM and 8:30AM.

2) The 8 Pointers ,who arrives class between 8:31 and 9:00 AM.

3) The Normal guys , who arrives class after 9:00 AM but before 10:00 AM ;)

4) The Unseen guys , who never go to class at any cost .

Prof. H.Pole is a Colorful Person . He will take class if the pattern of students arriving is **different from all the Previous day .**

What is the **maximum** number of days he will take classes ?
As the number can be large , print answer mod 1000000007

Input : First line contains T denoting no. of test cases Next T lines contains four integer a,b,c,d denoting 9 pointers,8 pointers, normal guys and Unseen guys

Output :maximumnumber of days he will take classes

**Constraints** : 1 <= T,a,b,c,d <= 10^5

**AUTHOR** : trico

Explanation

```
> Sample Test 3 0 0 0
>
> Here There are three 9 pointers, so pattern can be
1,2,3
1,3,2
2,1,3
2,3,1
3,1,2
3,2,1
Maximum number of days is 6 ;)
```

Time Limit:
1.0 sec(s)
for each input file.

Memory Limit:
256 MB

Source Limit:
1024 KB

Marking Scheme:
Marks are awarded when all the testcases pass.

Allowed Languages:
C,
C++,
Clojure,
C#,
D,
Erlang,
F#,
Go,
Groovy,
Haskell,
Java,
Java 8,
JavaScript(Rhino),
JavaScript(Node.js),
Lisp,
Lisp (SBCL),
Lua,
Objective-C,
OCaml,
Octave,
Pascal,
Perl,
PHP,
Python,
Python 3,
R(RScript),
Racket,
Ruby,
Rust,
Scala 2.11.8,
Swift,
Visual Basic

Initializing Code Editor...

{"8b6fe82": "/pagelets/suggested-problems/algorithm/prof-hpole-and-his-strict-classes/", "8b6fe5d": "/pagelets/show-submission/algorithm/prof-hpole-and-his-strict-classes/", "8b6fe99": "/pagelets/problem-author-tester/algorithm/prof-hpole-and-his-strict-classes/", "8b6feae": "/pagelets/problems-hint/algorithm/prof-hpole-and-his-strict-classes/", "8b6fec3": "/pagelets/recommended-problems/algorithm/prof-hpole-and-his-strict-classes/"}

{}

realtime.hackerearth.com

80

e42b65e1ae04372670e22aa85a41bd78383dcc98

58a29e5cae2309f04b28

/realtime/pusher/auth/