Fox Ciel has a board with *n* rows and *n* columns. So, the board consists of *n* × *n* cells. Each cell contains either a symbol '.', or a symbol '#'.

A cross on the board is a connected set of exactly five cells of the board that looks like a cross. The picture below shows how it looks.

Ciel wants to draw several (may be zero) crosses on the board. Each cross must cover exactly five cells with symbols '#', and any cell with symbol '#' must belong to some cross. No two crosses can share a cell.

Please, tell Ciel if she can draw the crosses in the described way.
The first line contains an integer *n* (3 ≤ *n* ≤ 100) — the size of the board.

Each of the next *n* lines describes one row of the board. The *i*-th line describes the *i*-th row of the board and consists of *n* characters. Each character is either a symbol '.', or a symbol '#'.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

void solvetask(){
    ll n;
    cin >> n;
    vector<ll> nums(10000000000000000000), som(n+1);
    for (int i = 0; i < n; i++) cin >> nums[i];
    sort(nums.begin(), nums.end());
    for (int i = 1; i <= n; i++) som[i] = som[i-1] + nums[i-1];
    ll resp = 0, l = 0, r = 0, i = n-1, resto = 0;
    while(r <= i){
        if(som[r] - som[l] + resto == nums[i]){
            resp += 1 + resto + som[r] - som[l];
            l = r;
            resto = 0;
            i--;
        }
        else if(som[r] - som[l] + resto >= nums[i]){
            resp += 1 + resto + som[r] - som[l];
            resto = (som[r] - som[l]) - nums[i];
            l = r;
            i--;
        }
        r++;
    }
    if(l <= i){
        ll temp = 0;
        for (int id = l; id < i; id++) temp += nums[l];
        resp += temp + min(((nums[i]-temp+1)/2) + 1, nums[i] + (i-l)); 
    }

    cout << resp << "\n";    
}

int main(){
    cin.tie(0)->sync_with_stdio(0);
    ll t = 1;
    cin >> t;
    while(t--) solvetask();
}