Factorial Fraction Equation
Time limit2sMemory limit512 MB
Count ordered pairs of positive integers (X, Y) satisfying 1/N! = 1/X + 1/Y, printing the exact value with no modulus.
- Level
Hard8 of 10
- Topics
- Number theory, Combinatorics, Math, Implementation
- Solved
- No attempts yet
Problem
You are given a positive integer . Write a program that counts the ordered pairs of positive integers satisfying the equation below.
Order matters. When , the pairs and count as two different solutions.
Input
The first line contains the integer ().
Output
Print the number of solutions on the first line. The count grows very large, so print the exact value without taking any modulus.