<p>Given an integer array <code>nums</code>, return <em>the sum of divisors of the integers in that array that have exactly four divisors</em>. If there is no such integer in the array, return <code>0</code>.</p>

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>

<pre>
<strong>Input:</strong> nums = [21,4,7]
<strong>Output:</strong> 32
<strong>Explanation:</strong> 
21 has 4 divisors: 1, 3, 7, 21
4 has 3 divisors: 1, 2, 4
7 has 2 divisors: 1, 7
The answer is the sum of divisors of 21 only.
</pre>

<p><strong class="example">Example 2:</strong></p>

<pre>
<strong>Input:</strong> nums = [21,21]
<strong>Output:</strong> 64
</pre>

<p><strong class="example">Example 3:</strong></p>

<pre>
<strong>Input:</strong> nums = [1,2,3,4,5]
<strong>Output:</strong> 0
</pre>

<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>

<ul>
	<li><code>1 &lt;= nums.length &lt;= 10<sup>4</sup></code></li>
	<li><code>1 &lt;= nums[i] &lt;= 10<sup>5</sup></code></li>
</ul>

int s[100001];

int speedup = [] {
    ios::sync_with_stdio(0); cin.tie(0);

    vector<int> primes;
    int lp[100001] {};
    for (int i = 2; i <= 100000; ++i) {
        if (!lp[i]) lp[i] = i, primes.push_back(i);
        int mx = lp[i], x;
        for (int p : primes) {
            if (p > mx || (x = i * p) > 100000) break;
            lp[x] = p;
        }
    }

    for (int i = 0, p1; p1 = primes[i], p1 <= 316; ++i)
        for (int j = i+1, p2, p; p2 = primes[j], p = p1*p2, p <= 100000; ++j)
            s[p] = 1 + p + p1 + p2;
    for (int i = 0, p, p2, p3; p = primes[i], p2 = p*p, p3 = p2*p, p3 <= 100000; ++i)
        s[p3] = 1 + p + p2 + p3;
    return 0;
}();

class Solution {
public:
    int sumFourDivisors(vector<int>& nums) {
        int res = 0;
        for (int n : nums) res += s[n];
        return res;
    }
};
16000