#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline int Chkmax(T &a, T b) {
  return a < b ? a = b, 1 : 0;
}
template <typename T>
inline int Chkmin(T &a, T b) {
  return a > b ? a = b, 1 : 0;
}
inline void proc_status() {
  ifstream t("/proc/self/status");
  cerr << string(istreambuf_iterator<char>(t), istreambuf_iterator<char>())
       << endl;
}
template <typename T>
T read() {
  T sum = 0, fl = 1;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') fl = -1;
  for (; isdigit(ch); ch = getchar()) sum = (sum << 3) + (sum << 1) + ch - '0';
  return sum * fl;
}
const int Maxn = 1000 + 100;
int N, A[Maxn], Vis[Maxn];
double P[Maxn][Maxn], Dp[Maxn], Prod[Maxn], Sum[Maxn];
inline void Solve() {
  for (int i = 1; i <= N; ++i) Prod[i] = Sum[i] = 1;
  A[1] = N, Dp[N] = 0, Vis[N] = 1;
  Dp[0] = 1e9;
  for (int i = 2; i <= N; ++i) {
    for (int j = 1; j <= N; ++j) {
      if (Vis[j]) continue;
      Sum[j] += Dp[A[i - 1]] * P[j][A[i - 1]] * Prod[j];
      Prod[j] *= (1.0 - P[j][A[i - 1]]);
      Dp[j] = Sum[j] / (1.0 - Prod[j]);
    }
    int pos = 0;
    for (int j = 1; j <= N; ++j)
      if (!Vis[j] && Dp[j] < Dp[pos]) pos = j;
    Vis[A[i] = pos] = 1;
  }
  printf("%.10lf\n", Dp[1]);
}
inline void Input() {
  N = read<int>();
  for (int i = 1; i <= N; ++i)
    for (int j = 1; j <= N; ++j) P[i][j] = 1.0 * read<int>() / 100;
}
int main() {
  Input();
  Solve();
  return 0;
}
