ifstream file("input.txt");
if (!file.is_open())
return 1;
int n;
file >> n;
vector<vector<double>> matrix(n, vector<double>(n + 1));
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
{
file >> matrix[i][j];
}
file >> matrix[i][n];
}
file.close();
cout << fixed << setprecision(1);
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
{
cout << setw(6) << matrix[i][j];
}
cout << setw(8) << matrix[i][n] << "\n";
}
cout << "\n";