Codey and Math
https://www.hackerrank.com/contests/codenection-2023-preliminary-round-closed-category/challenges/cn-c3
Question
Codey is very interested in Math, and it encountered an interesting question during its last mathematics class.
In an infinite sequence number: , Codey has been tasked with determining whether it's possible to obtain a sum equal to n by adding the numbers from l to r.
Codey wants you to find out if it's possible to achieve this sum. Print the values of l and r if so. If there are multiple answers, print any. Otherwise, print .
Note that this problem uses a custom checker, so make sure your program compiles correctly and prints the output according to the format before submitting.
Input Format
The first line contains an integer n, which represents the sum.
Constraints
Output Format
Output the values of l and r separated by a space where
that achieve the sum of n. If there are multiple answers, you can output any of them. Output if there is no solution.
Sample Inputs:
Last updated