include include include include include define LL long long using namespace std;const int N=1e6+77;int n,m,f[N],F[N],a[N],cnt,b[N];int head[N],nxt[2N],to[2N],tot;int dfn[N],low[N],stack[N],color[N],top,dfs_num,color_num;LL c[N],cc[N],num[N];bool vis[N];void add(int x,int y){ to[++tot]=y; nxt[t...