• [H] Sakuya's Fly Knife

  • 时间限制: 2000 ms 内存限制: 65535 K
  • 问题描述
  • Izayoi Sakuya(いざよい·さくや) is the chief maid of the Embodiment of Scarlet Devil.
    She's good at throwing fly knife.
    One day she wants to practise throwing it, so she puts T targets in an area N * M. Then Sakuya select a position to stand and start throwing the knives.
    You can imagine that the track of a fly knife is a ray and start from the postion where Sakuya stand. That means the knife can shoot all the targets where it goes through.
    But Sakuya is lazy that she don't want to caculate anything. Can you help her to select a position that Sakuya can throw least fly knives and shoot all the targets?

  • 输入
  • This problem contains several cases.
    The first line of each case has two integers - N, M (0 < N, M <= 100).
    Then follows a line that contains an integer T (0 < T <= min(N * M - 1, 100)).
    Then follows T lines. The ith line is two integers xi and yi(0 <= xi < N, 0 <= yi < M), indicates the ith target's coordinate.
  • 输出
  • For each case, you should output a coordinate, indicates the position (x, y) Sakuya should choose. If there're several position she can choose, then choose the minimum one.
    Then you should output the number of the fly knives.
    Notice that you can't choose a coordinate where there's a target.
  • 样例输入
  • 6 6
    3
    0 1
    1 2
    3 5
    
  • 样例输出
  • (2, 3) 2
    
  • 提示
  • 来源
  • XadillaX
  • 操作

显示春菜