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++,
C++14,
Clojure,
C#,
D,
Erlang,
F#,
Go,
Groovy,
Haskell,
Java,
Java 8,
JavaScript(Rhino),
JavaScript(Node.js),
Julia,
Kotlin,
Lisp,
Lisp (SBCL),
Lua,
Objective-C,
OCaml,
Octave,
Pascal,
Perl,
PHP,
Python,
Python 3,
R(RScript),
Racket,
Ruby,
Rust,
Scala,
Swift,
Visual Basic

Initializing Code Editor...

{"56f4b25": "/pagelets/recommended-problems/algorithm/prof-hpole-and-his-strict-classes/", "55323ca": "/pagelets/problem-author-tester/algorithm/prof-hpole-and-his-strict-classes/", "9c59ce8": "/pagelets/problems-hint/algorithm/prof-hpole-and-his-strict-classes/", "2e309fd": "/pagelets/show-submission/algorithm/prof-hpole-and-his-strict-classes/", "4ed1c50": "/pagelets/suggested-problems/algorithm/prof-hpole-and-his-strict-classes/"}

realtime.hackerearth.com

80

e42b65e1ae04372670e22aa85a41bd78383dcc98

58a29e5cae2309f04b28

/realtime/pusher/auth/