Play with acute angle

5

2 votes
Easy-Medium
Problem

convince yourself that the maximum number of regions in which 'n' lines can divide a plane can be expressed as : f(n)=f(n-1)+n
or simply
f(n)=1+n(n+1)/2*

You are given an integer N.

Find out the maximum number of regions in which N

acute angles can divide a plane.

since number of regions can be very large , ouput the required answer modulo (109+7) .

An acute angle can be

visualized as :

enter image description here

Input :

First line will contain an integer 'T' (number of test cases ).

For each test case there is an integer 'N' .

Output:

output the required answer for each test case on a new line.

Constraint :

T<=100000

1<=N<= 1018

Problem setter : Mohd Abdullah

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

test case 1 : N=1

enter image description here

test case 2 : N=2

enter image description here

Editor Image

?