Maurice Tutor

(5)

$15/per page/Negotiable

About Maurice Tutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Algebra,Applied Sciences See all
Algebra,Applied Sciences,Biology,Calculus,Chemistry,Economics,English,Essay writing,Geography,Geology,Health & Medical,Physics,Science Hide all
Teaching Since: May 2017
Last Sign in: 406 Weeks Ago, 2 Days Ago
Questions Answered: 66690
Tutorials Posted: 66688

Education

  • MCS,PHD
    Argosy University/ Phoniex University/
    Nov-2005 - Oct-2011

Experience

  • Professor
    Phoniex University
    Oct-2001 - Nov-2016

Category > Computer Science Posted 17 Sep 2017 My Price 7.00

number of transitions

The alphabet of Zorpia is quite peculiar. It consists of only two letters, A and B and that too in upper-case only. A visitor to Zorpia is amazed by the diversity of words formed by the combination of A and B. He notices one more peculiar thing about the words. All the words were of even length and the number of A’s in the word is equal to the number of B’s. One of the natives told him that it is the number of transitions in the word that guides the pronunciation of the words. The words having same number of transitions are pronounced almost similarly.

 

Let us define what transition means here. A transition occurs in a word whenever there is a change from A to B. Eg: consider the word ABAB. It has three transitions. First when going from index 1 to 2, second when going from 2 to 3 and third when going from 3 to 4.

 

Given the length of the word and the number of transitions, the visitor needs to find out how many such words are possible from the alphabet of Zorpia and following the rules for word as described above.

 

 

Input

 

The input consists of several test cases(5000 atmost). Each test case consists of two integers n and k where n is the length of word and n(2

 

Output

 

For every test case output on a line an integer which is the number of words possible modulo 1,000,000,007.

 

Example

Input: 6 2 6 3 0 0 Output: 4 8

 

Explanation

For the first case the 4 words are AABBBA, ABBBAA, BAAABB, BBAAAB

Answers

(5)
Status NEW Posted 17 Sep 2017 05:09 AM My Price 7.00

Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll

Not Rated(0)