Please solve the programming task below using a self-contained code snippet in a markdown code block.

You are given a 1-indexed integer array nums of length n.
An element nums[i] of nums is called special if i divides n, i.e. n % i == 0.
Return the sum of the squares of all special elements of nums.
 
Please complete the following python code precisely:
```python
class Solution:
    def sumOfSquares(self, nums: List[int]) -> int:
```