Codeforces Round 172 (Div. 2)
B
Nearest Fraction
Codeforces
1700
原题
← AC →
翻译中…

You are given three positive integers $*x*, *y*, *n*$. Your task is to find the nearest fraction to fraction image whose denominator is no more than $*n*$.

翻译中…

Formally, you should find such pair of integers $*a*, *b*$ $(1 ≤ *b* ≤ *n*; 0 ≤ *a*)$ that the value image is as minimal as possible.

翻译中…

If there are multiple "nearest" fractions, choose the one with the minimum denominator. If there are multiple "nearest" fractions with the minimum denominator, choose the one with the minimum numerator.

翻译中…

Input

翻译中…

A single line contains three integers $*x*, *y*, *n*$ $(1 ≤ *x*, *y*, *n* ≤ 10^{5})$.

翻译中…

Output

翻译中…

Print the required fraction in the format "$*a*$/$*b*$" (without quotes).

翻译中…

样例

Input #1
3 7 6
Output #1
2/5
InputCopy OutputCopy
Input #2
7 2 4
Output #2
7/2
InputCopy OutputCopy
题目信息
题号
281B
时间限制
2 s
内存限制
256 MB
标签
暴力
模拟
双指针

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。