4 1 1 2
5
By performing two operations as follows, you can make the number of black edges $5$.
* Choose $(a,b,c)=(1,3,4)$. Then, we have the following four black edges.
* The edge connecting vertices $1$ and $2$
* The edge connecting vertices $1$ and $3$
* The edge connecting vertices $1$ and $4$
* The edge connecting vertices $3$ and $4$
* Choose $(a,b,c)=(2,3,4)$. Then, we have the following five black edges.
* The edge connecting vertices $1$ and $2$
* The edge connecting vertices $1$ and $3$
* The edge connecting vertices $1$ and $4$
* The edge connecting vertices $2$ and $3$
* The edge connecting vertices $2$ and $4$
You cannot make the number of black edges more than $5$, so output $5$.7 3 1 2 2 3 3 6
20
123123 0
7579575003 Be careful about overflow.
{
"problem": {
"name": "Triangle Toggle",
"description": {
"content": "There is a complete graph with $N$ vertices numbered $1$ to $N$. Each edge is colored black or white. For $i=1,2,\\ldots,M$, the edge connecting vertices $U_i$ and $V_i$ is colored black, and all other",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "arc205_b"
},
"statements": [
{
"statement_type": "Markdown",
"content": "There is a complete graph with $N$ vertices numbered $1$ to $N$. Each edge is colored black or white. For $i=1,2,\\ldots,M$, the edge connecting vertices $U_i$ and $V_i$ is colored black, and all other...",
"is_translate": false,
"language": "English"
}
]
}