Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- #define h 100
- using namespace std;
- int main(){
- int mat[h][h], t, n, v, a, x, y, tot;
- scanf("%d", &t);
- while(t--){
- scanf("%d %d %d", &n, &v, &a);
- for(int i = 0; i < v; i++){
- for(int j = 0; j < v; j++){
- mat[i][j] = 0;
- }
- }
- for(int i = 0; i < a; i++){
- scanf("%d %d", &x, &y);
- mat[x][y] = 1;
- mat[y][x] = 1;
- }
- tot = 0;
- for(int i = 0; i < v; i++){
- for(int j = i; j < v; j++){
- tot += mat[i][j];
- }
- }
- printf("%d\n", tot * 2);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement