// Solution: Brute Force
// Try all possible coordinates from (0, 0) to (50, 50)
// Time complexity: O(|X|*|Y|*t)
// Space complexity: O(1)
class Solution {
    public int[] bestCoordinate(int[][] towers, int radius) {
        final int n = 50;
        int[] ans = new int[2];
        int max_q = 0;
        for (int x = 0; x <= n; ++x)
            for (int y = 0; y <= n; ++y) {
                int q = 0;
                for (int[] tower : towers) {
                    final int tx = tower[0], ty = tower[1];
                    final float d = (float)Math.sqrt((x - tx) * (x - tx) + (y - ty) * (y - ty));
                    if (d > radius) continue;
                    q += (int)Math.floor(tower[2] / (1 + d));
                }
                if (q > max_q) {
                    max_q = q;
                    ans = new int[]{x, y};
                }
            }
        return ans;
    }
}

@@ -601,16 +601,61 @@
  - ty));
+ // %E8%BF%99%E9%87%8C%E5%89%8D%E9%9D%A2%E7%94%A8float%E7%B1%BB%E5%9E%8B%E6%9D%A5%E6%8E%A5%E7%9A%84%EF%BC%8C%E6%89%80%E4%BB%A5%E5%90%8E%E9%9D%A2%E8%A6%81float%E7%B1%BB%E5%9E%8B%E6%9D%A5%E5%BC%BA%E5%88%B6%E8%BD%AC%E6%8D%A2%EF%BC%8C%E5%92%8CC++%E4%B8%8D%E5%90%8C%E3%80%82
 %0A       
@@ -879,16 +879,52 @@
 %5D%7Bx, y%7D;
+ // %E5%A4%A7%E6%8B%AC%E5%8F%B7%E9%87%8C%E9%9D%A2%E6%9C%89%E5%80%BC%EF%BC%8C%E4%B8%AD%E6%8B%AC%E5%8F%B7%E9%87%8C%E9%9D%A2%E4%B8%8D%E8%A6%81%E6%95%B0%E5%AD%97%E6%9D%A5%E5%88%9D%E5%A7%8B%E5%8C%96capacity!!!
 %0A       

update CoordinateWithMaximumNetworkQuality.java