← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
You are given a complete undirected graph on n vertices (every pair of distinct vertices is connected by a unique edge). Each edge e has an integer weight w(e) drawn from the set {1,2,…,m}. A pair of distinct edges (e1,e2) is called a “good pair” if the four endpoints of e1 and e2 are all distinct (i.e. the two edges are vertex-disjoint) and the sum of their weights is even. Count the number of good pairs in the graph. Return the count modulo 1 000 000 007.