#include using namespace std; const int mod = 998244353; typedef long long ll; const ll Inf=1e18; ll A[1005][1005]; int ans[1005][1005]; int N,M; void Floyd_4(){ for(int k = 1; k <= N; k++){ for(int i = 1; i <= N; i++){ if(k != i){ ll t = (k