#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 50;
const double INF = 1e18;
int n;
double p[N][N], dp[N], coe[N];
bool vs[N];
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;
  for (int i = 1; i <= n; i++) coe[i] = dp[i] = 1;
  dp[n] = coe[n] = 0;
  for (int i = 1; i <= n; i++) {
    int u = 0;
    double mn = INF;
    for (int j = 1; j <= n; j++)
      if (!vs[j] && dp[j] / (1 - coe[j]) < mn) u = j, mn = dp[j] / (1 - coe[j]);
    vs[u] = true;
    if (u == 1) {
      printf("%.10lf", mn);
      return 0;
    }
    for (int j = 1; j <= n; j++)
      dp[j] += mn * p[j][u] * coe[j], coe[j] *= 1 - p[j][u];
  }
  return 0;
}
