Rational Bubble Sort
You are given a sequence of integers. In one operation you may choose an adjacent pair and replace both values with their average. Formally, pick an index `i` and set both `a[i]` and `a[i+1]` to `(a[i] + a[i+1]) / 2`. The values are rational numbers after an operation, so later averages stay exact.