We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • Hackerrank Home
  • Practice
  • Certification
  • Compete
  • Career Fair
  • Hiring developers?
  1. All Contests
  2. ProjectEuler+
  3. Project Euler #15: Lattice paths

Project Euler #15: Lattice paths

Problem
Submissions
Leaderboard
Discussions

This problem is a programming version of Problem 15 from projecteuler.net

Starting in the top left corner of a grid, and only being able to move to the right and down, there are exactly routes to the bottom right corner.

How many such routes are there through a grid? As number of ways can be very large, print it modulo .

Input Format

The first line contains an integer , i.e., number of test cases.
Next lines will contain integers and .

Constraints

Output Format

Print the values corresponding to each test case.

Sample Input

2
2 2
3 2

Sample Output

6
10

Explanation

For as shown in statement above.

Author

shashank21j

Difficulty

Easy

Max Score

100

Submitted By

7735

Need Help?


View discussions
View top submissions

rate this challenge

MORE DETAILS

Download problem statement
Download sample test cases
Suggest Edits

Choose a translation


  • Contest Calendar
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy
  • Request a Feature