Subcontests
(5)The Kingdom of Moles
The Kingdom of Moles consists of 2023 cities, and there are several tunnels connecting different pairs of cities. Each tunnel allows bidirectional travel, and there is at most one tunnel connecting any two distinct cities. Furthermore, it is possible to travel between any two distinct cities through a combination of several tunnels.A pair of distinct cities {A,B} is considered good if it satisfies the following condition for any city C different from A and B:Let dC,A be the minimum number of tunnels required to travel from C to A, and let dC,B be the minimum number of tunnels required to travel from C to B. For any such pair {A,B}, it is guaranteed that regardless of the paths X and Y chosen to travel from C to A (using dC,A tunnels) and from C to B (using dC,B tunnels), respectively, X and Y do not share any common tunnel.Find the second largest possible value for the number of good pairs of cities. Note that the pairs {A,B} and {B,A} are considered the same combination. Long Long Long Game Again
A and B are playing a game on a blackboard. At the beginning, a positive real number x is fixed. First, A chooses a prime number p greater than or equal to 7. Then, B selects non-negative real numbers r1 and r2. A then chooses two integers s and t such that r1<s<r1+xp and r2<t<r2+xp, and writes on the blackboard the remainders of 0, s, t, and st when divided by p in this order.After that, A can repeatedly choose one of the following three operations as many times as they like:
[*] Choose an integer m between 1 and p−1 inclusive, and replace each of the four numbers on the blackboard with the remainder of adding m and then dividing by p.
[*] Choose an integer n between 2 and p−1 inclusive, and replace each of the four numbers on the blackboard with the remainder of multiplying by n and then dividing by p.
[*] Replace each of the four numbers on the blackboard with its remainder when squared and then divided by p, but this operation is not allowed if at least one of the four numbers is 0.A's objective is to make the numbers on the blackboard become 0, 2, 3, and 6 in that order. However, if there are no integers s and t that satisfy r1<s<r1+xp and r2<t<r2+xp, then A cannot achieve the objective.Find the maximum possible value of x such that regardless of A's actions, B can always prevent A from achieving the objective. GCD and arithmetic sequence
Let n be a positive integer with at least 4 positive divisors. Let d(n) be the number of positive divisors of n. Find all values of n for which there exists a sequence of d(n)−1 positive integers a1, a2, …, ad(n)−1 that forms an arithmetic sequence and satisfies the following condition: for any integers i and j with 1≤i<j≤d(n)−1, we have gcd(ai,n)=gcd(aj,n).