Please enter your email address or userHandle.
You are given an equation of the form x1+x2+...+xN=K. You need to find the total number of positive integral solutions of this equation.
The first line of the input contains an integer T, denoting the number of test cases. Then T test case follows. Each testcase contains a single line that denotes the equation.
Print the total number of positive integral solutions.
1 <= T <= 100
1 <= K <= 25
2 <= N <= 10
We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?
Login to access your submissions.
Please choose 'ReadOnlyMode' if you needn't to 'Edit' the problem e.g. viewing OJ's solution, TestCase Files (TCFs), TimeLimit etc.