CF546E Soldier and Traveling 题目描述 In the country there are \(n\) cities and \(m\) bidirectional roads between them. Each city has an army. Army of the i-th city consists of \(a_{i}\) soldiers. Now soldiers roam. After roaming each soldier has to eith…
题目描述 In the country there are n n n cities and m m m bidirectional roads between them. Each city has an army. Army of the i i i -th city consists of ai a_{i} ai soldiers. Now soldiers roam. After roaming each soldier has to either stay in his city o…