#include <bits/stdc++.h>
using namespace std;
double fract_diff(double num1, double denom1, double num2, double denom2) {
  return num1 * denom2 - num2 * denom1;
}
void check_val(double num, double denom, double x, double y, double &sola,
               double &solb, double &cur_diff_num, double &cur_diff_denom) {
  double diff_num = abs(num * y - denom * x);
  double diff_denom = denom * y;
  if (fract_diff(diff_num, diff_denom, cur_diff_num, cur_diff_denom) < 0) {
    cur_diff_num = diff_num;
    cur_diff_denom = diff_denom;
    sola = num;
    solb = denom;
  } else if (fract_diff(diff_num, diff_denom, cur_diff_num, cur_diff_denom) ==
             0) {
    if (denom < solb) {
      cur_diff_num = diff_num;
      cur_diff_denom = diff_denom;
      sola = num;
      solb = denom;
    } else if (denom == solb) {
      if (num < sola) {
        cur_diff_num = diff_num;
        cur_diff_denom = diff_denom;
        sola = num;
        solb = denom;
      }
    }
  }
}
int main(void) {
  double x, y, n;
  cin >> x >> y >> n;
  double difference_num = 10000000, difference_denom = 1;
  double sola, solb;
  for (double i = n; i >= 1; i--) {
    double num1 = floor(x / y * i);
    double num2 = ceil(x / y * i);
    double lower = num1 - 10;
    double higher = num2 + 10;
    for (double j = lower; j <= higher; j++) {
      check_val(j, i, x, y, sola, solb, difference_num, difference_denom);
      check_val(j, i, x, y, sola, solb, difference_num, difference_denom);
    }
  }
  cout << (int)sola << "/" << (int)solb << endl;
}

### 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;
double fract_diff(double num1, double denom1, double num2, double denom2) {
  return num1 * denom2 - num2 * denom1;
}
void check_val(double num, double denom, double x, double y, double &sola,
               double &solb, double &cur_diff_num, double &cur_diff_denom) {
  double diff_num = abs(num * y - denom * x);
  double diff_denom = denom * y;
  if (fract_diff(diff_num, diff_denom, cur_diff_num, cur_diff_denom) < 0) {
    cur_diff_num = diff_num;
    cur_diff_denom = diff_denom;
    sola = num;
    solb = denom;
  } else if (fract_diff(diff_num, diff_denom, cur_diff_num, cur_diff_denom) ==
             0) {
    if (denom < solb) {
      cur_diff_num = diff_num;
      cur_diff_denom = diff_denom;
      sola = num;
      solb = denom;
    } else if (denom == solb) {
      if (num < sola) {
        cur_diff_num = diff_num;
        cur_diff_denom = diff_denom;
        sola = num;
        solb = denom;
      }
    }
  }
}
int main(void) {
  double x, y, n;
  cin >> x >> y >> n;
  double difference_num = 10000000, difference_denom = 1;
  double sola, solb;
  for (double i = n; i >= 1; i--) {
    double num1 = floor(x / y * i);
    double num2 = ceil(x / y * i);
    double lower = num1 - 10;
    double higher = num2 + 10;
    for (double j = lower; j <= higher; j++) {
      check_val(j, i, x, y, sola, solb, difference_num, difference_denom);
      check_val(j, i, x, y, sola, solb, difference_num, difference_denom);
    }
  }
  cout << (int)sola << "/" << (int)solb << endl;
}

```