Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learning MySQL Get A Handle On Your Data

Authors: Seyed M M Tahaghoghi

1st Edition

0596529465, 9780596529468

Students also viewed these Databases questions