Let $n$ be a positive integer. Let $S$ be a set of ordered pairs $(x, y)$ such that $1\leq x \leq n$ and $0 \leq y \leq n$ in each pair, and there are no pairs $(a, b)$ and $(c, d)$ of different elements in $S$ such that $a^2+b^2$ divides both
$ac+bd$ and $ad - bc$. In terms of $n$, determine the size of the largest possible set $S$.
1. **Define the set \( T \) and the Gaussian integers:**
   Let \( T \coloneqq \left\{(a,b): 1 \leq a \leq n \, , \, 0 \leq b \leq n\right\} \). We can view the elements of \( T \) as non-zero Gaussian integers \( \left(a,b\right) \leftrightarrow a+bi \in \mathbb{Z}[i] \).

2. **Condition for divisibility in Gaussian integers:**
   For \( z_1 = a + bi \) and \( z_2 = c + di \) in \( T \), we have:
   \[
   \frac{z_2}{z_1} = \frac{c+di}{a+bi} = \frac{(c+di)(a-bi)}{(a+bi)(a-bi)} = \frac{ac+bd}{a^2+b^2} + \frac{ad-bc}{a^2+b^2} i
   \]
   This shows that the condition is equivalent to there being no two elements of \( S \) such that \( z_1 \mid z_2 \) in \( \mathbb{Z}[i] \).

3. **Choosing the set \( S \):**
   Choose \( S = \left\{(a,b) \in T : a+b \geq n+1\right\} \). The size of \( S \) is:
   \[
   |S| = \frac{n(n+1)}{2}
   \]

4. **Bounding the magnitude of elements in \( S \):**
   For any \( z \in S \), we have:
   \[
   \sqrt{2} \, n \geq |z| \geq \sqrt{2\left(\frac{n+1}{2}\right)^2} = \sqrt{2} \, \frac{n+1}{2}
   \]

5. **Contradiction argument:**
   Assume for contradiction that there are distinct \( z_1, z_2 \in S \) such that \( z_1 \mid z_2 \). Writing \( w = \frac{z_1}{z_2} \), we have:
   \[
   1 \leq |w| = \frac{|z_1|}{|z_2|} \leq \frac{\sqrt{2} \, n}{\sqrt{2} \, \frac{n+1}{2}} < 2
   \]
   So \( |w| = 1 \), meaning \( w \in \{-1, -i, i\} \) (since \( w \neq 1 \)). But writing \( z_1 = a + bi \), we have:
   \[
   z_2 \in \left\{\frac{z_1}{-1}, \frac{z_1}{-i}, \frac{z_1}{i}\right\} = \left\{-a - bi, -b + ai, b - ai\right\}
   \]
   None of these are in \( T \), giving a contradiction. Thus \( S \) has the desired properties.

6. **Maximal size of \( S \):**
   Define equivalence classes on \( T \) with \( z_1 \sim z_2 \) iff \( \frac{z_1}{z_2} \) or \( \frac{z_2}{z_1} \) is of the form \( i^n \cdot \omega^m \) for \( n, m \in \mathbb{Z}_{\geq 0} \), where \( \omega = 1 + i \). \( S \) can contain at most one element from each equivalence class. We need to show there are at most \( \frac{n(n+1)}{2} \) such equivalence classes.

7. **Equivalence class claim:**
   **Claim:** Each equivalence class contains an element \( a + bi \in T \) such that \( a + b \) is odd.
   **Proof:** Choose an equivalence class \( \tilde{T} \subset T \) and let \( a + bi \in \tilde{T} \). If \( a + b \) is odd, we are done. Otherwise, \( a + b \) is even. From the earlier equation:
   \[
   \frac{a+bi}{1+i} = \frac{a+b}{2} + \frac{b-a}{2}i \quad \text{and} \quad \frac{a+bi}{i^3 (1+i)} = \frac{a-b}{2} + \frac{a+b}{2}i
   \]
   These will both be Gaussian integers as \( a, b \) are even. If \( b \geq a \), the former will be in \( T \), and if \( a > b \), the latter will be in \( T \).

8. **Counting elements with odd \( a + b \):**
   There are \( \frac{|T|}{2} = \frac{n(n+1)}{2} \) elements of \( T \) with \( a + b \) odd, providing an upper bound on the number of equivalence classes.

The final answer is \( \boxed{\frac{n(n+1)}{2}} \).