#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 10;
int n;
bool vis[N];
double e[N], p[N][N], prod[N], mn;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) scanf("%lf", &p[i][j]), p[i][j] /= 100.0;
  if (n == 1) {
    puts("0");
    return 0;
  }
  for (int i = 1; i <= n; i++) e[i] = 1, prod[i] = 1 - p[i][n];
  e[n] = 0, vis[n] = true;
  for (int i = 1, t; i <= n; i++) {
    t = 0;
    mn = 1e18;
    for (int j = 1; j <= n; j++)
      if (!vis[j] && e[j] / (1 - prod[j]) < mn)
        t = j, mn = e[j] / (1 - prod[j]);
    vis[t] = true;
    if (t == 1) break;
    for (int j = 1; j <= n; j++)
      e[j] += mn * p[j][t] * prod[j], prod[j] *= (1 - p[j][t]);
  }
  printf("%.10lf\n", mn);
  return 0;
}
