N-dimensional plane
Practice
4.1 (7 votes)
Combinatorics
Basics of combinatorics
Math
C++
Problem
86% Success 927 Attempts 30 Points 5s Time Limit 256MB Memory 1024 KB Max Code

You are at the origin in the N-dimensional plane and want to go some point in the plane in the minimum number of steps. Formally, with every step you take, you must decrease the distance between you and the end place by one.

If you are provided with the endpoint, calculate the number of different ways you can go to the endpoint mod $$10^9 + 7$$.

Input format

  • The first line contains $n$.
  • The second line contains $n$ integers denoting the coordinate of the destination.

Output format

Print the number of ways you can reach the destination mod $$10^9 + 7$$.

Constraints

$$1 \le t \le 50$$

$$1 \le n \le 10^5$$

It is guaranteed that the minimum distance that will be moved from origin to endpoint will be less than or equal to $$2*10^5$$.

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:30
2 votes
Tags:
AlgorithmsMathCombinatoricsBasics of Combinatorics
Points:30
18 votes
Tags:
CombinatoricsMathMedium
Points:30
4 votes
Tags:
CombinatoricsMathMediumNumber Theory