A little bee (hangdian 2044)

Source: Internet
Author: User

/* A little bee
Problem description
A trained bee can only crawl to the adjacent beehive on the right, and cannot reverse crawl. Calculate the number of possible routes for bees to climb from Master A to Master B.
The structure of the beehive is as follows.


 

Input
The first row of the input data is an integer N, indicating the number of test instances, followed by N rows of data. Each row contains two integers A and B (0 <A <B <50 ).

 

Output
For each test instance, output the number of possible routes for the bee to climb from the master a to the Master B. The output of each instance occupies one line.

 

Sample Input
2
1 2
3 6
 

Sample output
1
3

*/# Include <cstdio>
_ Int64 s [100] = };
Int main ()
{
Int test;
Scanf ("% d", & test );
While (test --)
{
Int I, A, B, J, sum = 0;
Scanf ("% d", & A, & B );
For (I = 3; I <50; I ++)
{
S [I] = s [I-1] + s [I-2];
}
Printf ("% i64d \ n", s [B-A]);
}
// While (1 );
Return 0;

}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.