1. Abridged Problem Statement
Given a directed graph of n cities and m one-way roads (edges), you may choose at most one of these roads and make it two-way (i.e. add its reverse). Define the "degree of development" as the size of the largest strongly connected subset of cities (i.e. largest strongly connected component).
• Compute the maximum degree of development w achievable by upgrading at most one road.
• List all road indices which, when made two-way, achieve this maximum w.

2. Detailed Editorial

Overview
We must consider, for each original edge e = (u→v), what happens if we add the reverse edge v→u. That additional edge can merge multiple strongly connected components (SCCs) in the condensation DAG. We need to compute the resulting largest SCC size for each choice, pick the maximum size w, and report all edges e achieving w.

Step A: Compute SCCs of the original graph
– Run Kosaraju to label each vertex with its SCC index comp[v], total C SCCs.
– Record comp_size[c] = number of original vertices in SCC c.
– Build the condensation DAG: for each original edge (u→v) if comp[u]≠comp[v], add a DAG edge comp[u]→comp[v]. Remove duplicates.

Step B: Topological order and reachability closure
– Compute a topological order of the DAG (Kahn's algorithm).
– Build forward reachability closure[c]: bitset<1024> of components reachable from c (including c itself).
  Process in reverse topological order: for each u, closure[u] |= closure[v] for each v in adj[u].

Step C: Evaluate each edge
For each original road i: u→v
  let cu = comp[u], cv = comp[v].
  If cu==cv, upgrading does nothing; the merged SCC size equals comp_size[cu].
  Else:
    A component i merges into the new SCC if and only if cu can reach i AND i can reach cv in the condensation.
    Using only the forward closure: check closure[cu][i] && closure[i][cv].
    Compute merged_size = sum of comp_size[i] for all i where will_merge[i] is true.
    Compute current_max = max(merged_size, largest non-merged comp_size).
  Track the global maximum w and collect all edges i for which current_max = w.

Complexities
– SCC (Kosaraju): O(n+m)
– Building DAG & topo: O(C + #dag_edges) ≤ O(n + m)
– Computing closure with bitsets: O(C²/w)
– Loop over m edges each in O(n + C) = O(m·n) ≤ 2·10^7 in worst case. Acceptable for n≤1000, m≤20000.

3. Provided C++ Solution
```cpp
#include <bits/stdc++.h>
using namespace std;

class StronglyConnectedComponents {
  private:
    vector<bool> visited;

    void dfs1(int u) {
        visited[u] = true;
        for(int v: adj[u]) {
            if(!visited[v]) {
                dfs1(v);
            }
        }
        top_sort.push_back(u);
    }

    void dfs2(int u) {
        for(int v: radj[u]) {
            if(comp[v] == -1) {
                comp[v] = comp[u];
                dfs2(v);
            }
        }
    }

  public:
    int n;
    vector<vector<int>> adj, radj;
    vector<int> comp, comp_ids, top_sort;

    StronglyConnectedComponents() {}
    StronglyConnectedComponents(int _n) { init(_n); }

    void add_edge(int u, int v) {
        adj[u].push_back(v);
        radj[v].push_back(u);
    }

    void init(int _n) {
        n = _n;
        comp_ids.clear();
        top_sort.clear();
        adj.assign(n, {});
        radj.assign(n, {});
    }

    void find_components() {
        comp.assign(n, -1);
        visited.assign(n, false);

        for(int i = 0; i < n; i++) {
            if(!visited[i]) {
                dfs1(i);
            }
        }

        reverse(top_sort.begin(), top_sort.end());
        for(int u: top_sort) {
            if(comp[u] == -1) {
                comp[u] = (int)comp_ids.size();
                comp_ids.push_back(comp[u]);
                dfs2(u);
            }
        }
    }
};

int n, m;
vector<pair<int, int>> edges;
StronglyConnectedComponents G;

void read() {
    cin >> n >> m;
    edges.resize(m);
    G.init(n);
    for(int i = 0; i < m; i++) {
        int u, v;
        cin >> u >> v;
        u--, v--;
        edges[i] = {u, v};
        G.add_edge(u, v);
    }
}

void solve() {
    // Both N and M aren't huge, and the naive solution is O(M^2) with trying to
    // add every edge and then finding the largest strongly connected component.
    // However, to have something acceptable we would have to implement a O(NM)
    // approach. This is possible by a slight modification - we will only
    // calculate the strongly connected components decomposition in the
    // beginning in O(M), and then calculate the transitive closure between the
    // components in O(NM), or even O(NM/w) with bitset (word size w = 32 or
    // 64). We will then try every edge (u, v) and if u and v are in different
    // components, we will add an edge v -> u (note u -> v are already an edge),
    // we will merge comp[u], comp[v], and all w such that C[comp[u], w] and
    // C[w, comp[v]] (here C[x, y] means y is reachable from x or essentially
    // this is the transitive closure). This check can be done in O(N) by simply
    // iterating through all w, which is quicker than O(M).

    G.find_components();

    int num_components = G.comp_ids.size();

    vector<vector<bool>> used(
        num_components, vector<bool>(num_components, false)
    );
    vector<vector<int>> comp_adj(num_components);
    vector<int> indegree(num_components, 0);

    for(int i = 0; i < m; i++) {
        int u = edges[i].first, v = edges[i].second;
        int cu = G.comp[u], cv = G.comp[v];
        if(cu != cv && !used[cu][cv]) {
            used[cu][cv] = true;
            comp_adj[cu].push_back(cv);
            indegree[cv]++;
        }
    }

    vector<int> comp_size(num_components, 0);
    for(int i = 0; i < n; i++) {
        comp_size[G.comp[i]]++;
    }

    queue<int> q;
    vector<int> topo_order;
    for(int i = 0; i < num_components; i++) {
        if(indegree[i] == 0) {
            q.push(i);
        }
    }

    while(!q.empty()) {
        int u = q.front();
        q.pop();
        topo_order.push_back(u);

        for(int v: comp_adj[u]) {
            indegree[v]--;
            if(indegree[v] == 0) {
                q.push(v);
            }
        }
    }

    vector<bitset<1024>> closure(num_components);
    for(int i = 0; i < num_components; i++) {
        closure[i][i] = 1;
    }
    for(int i = num_components - 1; i >= 0; i--) {
        int u = topo_order[i];
        for(int v: comp_adj[u]) {
            closure[u] |= closure[v];
        }
    }

    int max_size = 0;
    vector<int> good_edges;

    for(int edge_idx = 0; edge_idx < m; edge_idx++) {
        int u = edges[edge_idx].first, v = edges[edge_idx].second;
        int cu = G.comp[u], cv = G.comp[v];

        vector<bool> will_merge(num_components, false);
        for(int i = 0; i < num_components; i++) {
            if(closure[cu][i] && closure[i][cv]) {
                will_merge[i] = true;
            }
        }

        vector<int> new_comp_size(num_components, 0);
        int merged_size = 0;

        for(int i = 0; i < n; i++) {
            int comp_id = G.comp[i];
            if(will_merge[comp_id]) {
                merged_size++;
            } else {
                new_comp_size[comp_id]++;
            }
        }

        int current_max = merged_size;
        for(int i = 0; i < num_components; i++) {
            current_max = max(current_max, new_comp_size[i]);
        }

        if(current_max > max_size) {
            max_size = current_max;
            good_edges = {edge_idx + 1};
        } else if(current_max == max_size) {
            good_edges.push_back(edge_idx + 1);
        }
    }

    if(m == 0) {
        max_size = 1;
        good_edges = {};
    }

    cout << max_size << endl;
    cout << good_edges.size() << endl;
    for(int i = 0; i < (int)good_edges.size(); i++) {
        if(i > 0) {
            cout << " ";
        }
        cout << good_edges[i];
    }
    if(!good_edges.empty()) {
        cout << endl;
    }
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int T = 1;
    for(int test = 1; test <= T; test++) {
        read();
        solve();
    }

    return 0;
}
```

4. Python Solution with Detailed Comments
```python
import sys
sys.setrecursionlimit(10**7)

def readints():
    return map(int, sys.stdin.readline().split())

# 1) Read input
n, m = map(int, sys.stdin.readline().split())
edges = []
g = [[] for _ in range(n)]
rg = [[] for _ in range(n)]
for _ in range(m):
    u, v = map(int, sys.stdin.readline().split())
    u -= 1; v -= 1
    edges.append((u, v))
    g[u].append(v)
    rg[v].append(u)

# 2) Kosaraju to find SCCs
visited = [False]*n
order = []
def dfs1(u):
    visited[u] = True
    for w in g[u]:
        if not visited[w]:
            dfs1(w)
    order.append(u)

for i in range(n):
    if not visited[i]:
        dfs1(i)

comp = [-1]*n
cid = 0
def dfs2(u, cid):
    comp[u] = cid
    for w in rg[u]:
        if comp[w] == -1:
            dfs2(w, cid)

# process in reverse finishing order
for u in reversed(order):
    if comp[u] == -1:
        dfs2(u, cid)
        cid += 1

C = cid  # number of components

# 3) comp_size and build DAG of components
comp_size = [0]*C
for v in range(n):
    comp_size[comp[v]] += 1

cadj = [set() for _ in range(C)]
rcadj = [set() for _ in range(C)]
for u, v in edges:
    cu, cv = comp[u], comp[v]
    if cu != cv:
        cadj[cu].add(cv)
        rcadj[cv].add(cu)

# 4) Topological sort of the DAG (Kahn's algorithm)
indeg = [0]*C
for u in range(C):
    for v in cadj[u]:
        indeg[v] += 1

from collections import deque
q = deque(i for i in range(C) if indeg[i] == 0)
topo = []
while q:
    u = q.popleft()
    topo.append(u)
    for v in cadj[u]:
        indeg[v] -= 1
        if indeg[v] == 0:
            q.append(v)

# 5) Forward reachability with Python ints as bitsets
closure = [0]*C
# each comp can reach itself
for i in range(C):
    closure[i] = 1 << i

# forward closure: process reverse topo
for u in reversed(topo):
    for v in cadj[u]:
        closure[u] |= closure[v]

# 6) Evaluate each edge
best = 0
ans = []

if m == 0:
    # no edges: best is any single node
    best = 1
else:
    for idx, (u, v) in enumerate(edges, start=1):
        cu, cv = comp[u], comp[v]
        if cu == cv:
            cur = comp_size[cu]
        else:
            # components that merge are those c with
            # bit c set in closure[cu] AND closure[c] has bit cv set
            merged_size = 0
            other_max = 0
            for c in range(C):
                if (closure[cu] >> c) & 1 and (closure[c] >> cv) & 1:
                    merged_size += comp_size[c]
                else:
                    other_max = max(other_max, comp_size[c])
            cur = max(merged_size, other_max)
        if cur > best:
            best = cur
            ans = [idx]
        elif cur == best:
            ans.append(idx)

# 7) Output result
print(best)
print(len(ans))
if ans:
    print(*ans)
```

5. Compressed Editorial
– Find SCCs, form condensation DAG.
– Compute forward reachability closure on the DAG via bitsets in reverse topological order.
– For each original edge (u→v), if it links different components cu→cv, a component i merges if closure[cu][i] is set AND closure[i][cv] is set. Sum their sizes; compare with the largest unaffected component. If cu=cv, no change.
– Track the maximum resulting SCC size w and list all edges achieving w.
