Question: C Programming Language Problem Title: Classic Math Problem Lili likes to read books. One day, when he opened the mathematics book, there was a problem

C Programming Language

Problem Title: Classic Math Problem

Lili likes to read books. One day, when he opened the mathematics book, there was a problem which he found interesting to do. The problem can be defined as follows.

C Programming Language Problem Title: Classic Math Problem Lili likes to read

This function is infinite function. But this time, the function only repeats for N times and Lili who was quite curious about the problem wanted to solve it appropriately. Help Lili by provide her the right answer for the problem to make sure her answer is the correct answer.

Format Input

Input consists of one integer T, as the number of test case. For each test case, followed by two integers N and x - number of repetition on the function and the value of x as value to be substituted to the function f(x) above. N will specify the number of x values that appear in the function..

Format Output

Output should be expressed in format Case #X: Y1/Y2 - X is the number of the test case, and followed by Y1 and Y2 as the nominator and denominator of the result, and also the result is represented in the simplest form such that Y1 and Y2 are relatively prime (co-prime) or GCD(Y1, Y2) = 1.

Constraints

1 T 1000 1 N 5 1 x 1000

Sample Input & Output (standard input & output)

3

3 5

Case #1: 135/26

1 7

Case #2: 7/1

4 2

Case #3: 29/12

f(x) = x + + + T

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!