#include <bits/stdc++.h>
using namespace std;
inline long long int in() {
  long long int p = 0;
  register char ch = 0;
  while (ch < '0' or ch > '9') {
    ch = getchar();
  }
  while (ch >= '0' and ch <= '9') {
    p = (p << 1) + (p << 3) + ch - '0';
    ch = getchar();
  }
  return p;
}
bool IsPowerOfTwo(long long int x) { return (x != 0) && ((x & (x - 1)) == 0); }
long long int poer(long long int a, long long int b) {
  long long int rs = 1;
  while (b > 0) {
    if (b & 1) rs *= a;
    a *= a;
    b /= 2;
  }
  return rs;
}
long long int mod_poer(long long int a, long long int b, long long int mo) {
  long long int rs = 1;
  while (b > 0) {
    if (b & 1) rs = (rs * a) % mo;
    a = (a * a) % mo;
    b /= 2;
  }
  return rs % mo;
}
long long int d, x, y;
void ext_euclid(long long int a, long long int b) {
  if (b == 0) {
    d = a;
    x = 1;
    y = 0;
  } else {
    ext_euclid(b, a % b);
    long long int temp = x;
    x = y;
    y = temp - (a / b) * y;
  }
}
long long int mod_inverse1(long long int a, long long int m) {
  ext_euclid(a, m);
  return (x % m + m) % m;
}
long long int mod_inverse2(long long int a, long long int m) {
  return mod_poer(a, m - 2, m);
}
long long int gcd(long long int a, long long int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int a, b, n;
  cin >> a >> b >> n;
  if (n >= b) {
    cout << a / gcd(a, b) << "/" << b / gcd(a, b) << endl;
  } else {
    long double x = a * 1.0 / b * 1.0;
    long long int ans1, ans2;
    for (long long int i = 1; i <= n; ++i) {
      long long int l = 0, r = 100000;
      while (l <= r) {
        long long int mid = (l + r) / 2;
        if ((long double)(mid * 1.0 / (i * 1.0)) >= x)
          r = mid - 1;
        else
          l = mid + 1;
      }
      if (fabs((long double)((l - 1) * 1.0 / (i * 1.0) - x)) <
          fabs((long double)((ans1 * 1.0) / (ans2 * 1.0) - x)))
        ans1 = l - 1, ans2 = i;
      if (fabs((long double)((l)*1.0 / (i * 1.0) - x)) <
          fabs((long double)((ans1 * 1.0) / (ans2 * 1.0) - x)))
        ans1 = l, ans2 = i;
    }
    cout << ans1 / gcd(ans1, ans2) << "/" << ans2 / gcd(ans1, ans2) << endl;
  }
  return 0;
}

### Prompt

Please provide a cpp coded solution to the problem described below:

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 ≤ 105).

Output

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

Examples

Input

3 7 6


Output

2/5


Input

7 2 4


Output

7/2

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
inline long long int in() {
  long long int p = 0;
  register char ch = 0;
  while (ch < '0' or ch > '9') {
    ch = getchar();
  }
  while (ch >= '0' and ch <= '9') {
    p = (p << 1) + (p << 3) + ch - '0';
    ch = getchar();
  }
  return p;
}
bool IsPowerOfTwo(long long int x) { return (x != 0) && ((x & (x - 1)) == 0); }
long long int poer(long long int a, long long int b) {
  long long int rs = 1;
  while (b > 0) {
    if (b & 1) rs *= a;
    a *= a;
    b /= 2;
  }
  return rs;
}
long long int mod_poer(long long int a, long long int b, long long int mo) {
  long long int rs = 1;
  while (b > 0) {
    if (b & 1) rs = (rs * a) % mo;
    a = (a * a) % mo;
    b /= 2;
  }
  return rs % mo;
}
long long int d, x, y;
void ext_euclid(long long int a, long long int b) {
  if (b == 0) {
    d = a;
    x = 1;
    y = 0;
  } else {
    ext_euclid(b, a % b);
    long long int temp = x;
    x = y;
    y = temp - (a / b) * y;
  }
}
long long int mod_inverse1(long long int a, long long int m) {
  ext_euclid(a, m);
  return (x % m + m) % m;
}
long long int mod_inverse2(long long int a, long long int m) {
  return mod_poer(a, m - 2, m);
}
long long int gcd(long long int a, long long int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int a, b, n;
  cin >> a >> b >> n;
  if (n >= b) {
    cout << a / gcd(a, b) << "/" << b / gcd(a, b) << endl;
  } else {
    long double x = a * 1.0 / b * 1.0;
    long long int ans1, ans2;
    for (long long int i = 1; i <= n; ++i) {
      long long int l = 0, r = 100000;
      while (l <= r) {
        long long int mid = (l + r) / 2;
        if ((long double)(mid * 1.0 / (i * 1.0)) >= x)
          r = mid - 1;
        else
          l = mid + 1;
      }
      if (fabs((long double)((l - 1) * 1.0 / (i * 1.0) - x)) <
          fabs((long double)((ans1 * 1.0) / (ans2 * 1.0) - x)))
        ans1 = l - 1, ans2 = i;
      if (fabs((long double)((l)*1.0 / (i * 1.0) - x)) <
          fabs((long double)((ans1 * 1.0) / (ans2 * 1.0) - x)))
        ans1 = l, ans2 = i;
    }
    cout << ans1 / gcd(ans1, ans2) << "/" << ans2 / gcd(ans1, ans2) << endl;
  }
  return 0;
}

```