Codeforces Round 172 (Div. 2)
翻译中…
You are given three positive integers $*x*, *y*, *n*$. Your task is to find the nearest fraction to fraction
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
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
题目信息
标签
暴力
模拟
双指针
题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。