#include <iostream>
#include <vector>
using namespace std;
int main() {
int V = 8;
int E = 16;
vector<pair<int, int>> edges = {
{1, 2}, {1, 3}, {1, 5}, {1, 6},
{2, 3}, {2, 4}, {2, 7}, {3, 4},
{3, 8}, {4, 5}, {4, 7}, {5, 6},
{5, 8}, {6, 7}, {6, 8}, {7, 8}
};
vector<int> adjList[9];
for (auto e : edges) {
adjList[[Link]].push_back([Link]);
adjList[[Link]].push_back([Link]);
cout << "Adjacency List Representation:\n";
for (int i = 1; i <= V; i++) {
cout << i << " -> ";
for (int j : adjList[i])
cout << j << " ";
cout << "\n";
int adjMatrix[9][9] = {0};
for (auto e : edges) {
adjMatrix[[Link]][[Link]] = 1;
adjMatrix[[Link]][[Link]] = 1;
cout << "\nAdjacency Matrix Representation:\n";
for (int i = 1; i <= V; i++) {
for (int j = 1; j <= V; j++)
cout << adjMatrix[i][j] << " ";
cout << "\n";
return 0;