A fraction **a/b** has a decimal representation which becomes periodic after some time.

For eg: lets us consider the fraction 1/9 , its decimal representation is 0.11111... We say it has a period of 1 with last digit '1' repeating. Let's take the fraction 1/6, its decimal representation is 0.1666666.. So, it has a period of 1 with the last digit '6' repeating.

Given the period **'p'** and a decimal expansion **'f'** . Your task is to represent it in the form of **'a/b'** .

**Note:** The period **'p'** represents that the last p digits of **'f'** is repeating. **f** can has at most 16 digits in its decimal expansion. Output the required number **'a/b'** in the simplest form.

**Input:**

The first line of input contains an integer **T** denoting the number of test cases. Each line of test case contains 2 number **p & f** as explained in the problem statement.

**Output:**

For each test case, output the required number in the form of **'a/b'**.

**Constraints:**

1 <= T <= 20

0 <= p <= 16

0 < f < 1

**Example:**

**Input:**

3

1 0.1

2 0.81

1 0.16

**Output:**

1/9

9/11

1/6

Author: pra1nay7_313

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

Sulagna | 117 |

RUTVIKHARIPARA | 116 |

janvidavda105190 | 93 |

harshsiddhapura105461 | 93 |

devsinghindra | 80 |

PiyushPandey4 | 614 |

ASWATHAMA | 561 |

akhyasharma01 | 547 |

john_wick | 521 |

jagrit_07 | 443 |

blackshadows | 5362 |

Ibrahim Nash | 5242 |

akhayrutdinov | 5111 |

mb1973 | 4929 |

Quandray | 4598 |

Login to report an issue on this page.