For which pairs of positive integers $(m,n)$ there exists a set $A$ such that for all positive integers $x,y$, if $|x-y|=m$, then at least one of the numbers  $x,y$ belongs to the set $A$, and if $|x-y|=n$, then at least one of the numbers $x,y$ does not belong to the set $A$?

[i]Adapted by Dan Schwarz from A.M.M.[/i]
1. **Claim**: It is possible to find such a set \( A \) if and only if \( m \) and \( n \) have the same maximum power of 2 dividing them.

2. **Proof**:
    - Suppose \( x \in A \). Then:
        - \( x + n \notin A \) (since \( |x - (x + n)| = n \))
        - \( x + n + m \in A \) (since \( |(x + n) - (x + n + m)| = m \))
        - \( x + m \notin A \) (since \( |x - (x + m)| = m \))
    - Similarly, if \( x \notin A \):
        - \( x + m \in A \)
        - \( x + m + n \notin A \)
        - \( x + n \in A \)

3. **Induction**:
    - By induction, if \( x \in A \), then \( x + (2k+1)m \notin A \) and \( x + 2ln \in A \).
    - This implies that the equation \((2k+1)m = 2ln\) has no solutions, meaning the fraction \(\frac{m}{n}\) cannot be expressed as an even number divided by an odd number.
    - Similarly, \(\frac{m}{n}\) cannot be expressed as an odd number divided by an even number either.
    - Therefore, in lowest terms, the fraction \(\frac{m}{n}\) must be an odd number divided by an odd number. This means \( m \) and \( n \) must have the same maximum power of 2 dividing them.

4. **Verification**:
    - If \( m \) and \( n \) are both odd, consider the set \( A \) of odd numbers. This set works because:
        - If \( x \) is odd and \( y \) is even, then \( |x - y| \) is odd, and one of \( x \) or \( y \) is in \( A \).
        - If \( x \) and \( y \) are both odd or both even, then \( |x - y| \) is even, and one of \( x \) or \( y \) is not in \( A \).

5. **Induction on the highest power of 2**:
    - Let \( 2^{s+1} \) be the highest power of 2 dividing \( m \) and \( n \).
    - Consider numbers modulo \( 2^{s+1} \). For a fixed \( t \) where \( 0 \leq t < 2^{s+1} \), let \( a = r \cdot 2^{s+1} + t \).
    - Biject this number to \( r \). Let \( A \) in this bijected set consist of all odd numbers.
    - Biject it back to get a suitable set \( A \) for the real numbers.
    - Repeat this for every value of \( t \) to get a working construction.

The final answer is \( \boxed{ (m, n) } \) such that \( m \) and \( n \) have the same maximum power of 2 dividing them.