# Amex OA

Vaish is very fond of series and patterns. She is creative to the core and loves to solve the series. She always brings new series for her friends to solve. Last week she was working on something where she thought of an interesting series and now wants you to see if you can guess the series correctly or not. She is very excited about it and has decided that she will give you the first 7 terms of the series for help and the rest will have to be figured out by you.

First 7 terms of the series 1122426
Vaish will further provide you with an integer N and expects you to print all the N terms of the series space separately. Guess the series and print accordingly.

Input Format
The first line of input consists of the number of test cases, T

Next T lines consist of the value of N.

Constraints
1<= T <=100

1<= N <=250

Output Format
For each test case, print the space-separated N terms of the series in a separate line.

Sample TestCase 1
Input
1
7
Output
1122426

Given an integer N, return the maximum possible value obtained by inserting one ‘5’ digit inside the decimal representation of integer N.
e.g.
N = 268, return 5268
N = 680, return 6850
N = 0, return 50
N = -999, return -5999
Assume that N is an integer within the range [-8000, 8000]
Focus on correctness

####################
Given two integers A and B, return the number of integers from the range [A,B] inclusive that can be expressed as the product of two consecutive integers.
e.g.
Given A = 6, B = 20, return 3.
Because 2* 3 = 6, 3* 4 = 12, and 4*5 = 20.

Write an efficient algo Given two integers A and B, return the number of integers from the range [A,B] inclusive that can be expressed as the product of two consecutive integers.
e.g.
Given A = 6, B = 20, return 3.
Because 2* 3 = 6, 3* 4 = 12, and 4*5 = 20.

Intern.

you are given 2 int arrays.

``````					A=[1,   2,   1]
B=[2,   3,   3]

so fractions are: 1/2, 2/3,  1/3
``````

A is numerator, B is denominator.
so fractions are: 1/2, 2/3, 1/3
find all pairs that sum upto 1.
example:
here we have 2/3 + 1/3 = 1 so count = 1
return 1

return modulo 10^ +7 since input can be large

i did it in O(n^2) by going through it once and then computing addition of the 2 and checking if its one and updating counter.
is O(n) possible?