• [1477] AmeriDarts

  • 时间限制: 1000 ms 内存限制: 65535 K
  • 问题描述
  • AmeriDarts is a dangerous but full of glamour. Mr.cai wants to have a try.
    The rule is simple:throw some boomerangs in a line from left to right as quickly as you can. You are asked to throw twice, first time throw A red boomerangs, second time throw B blue boomerangs. Your score is to calculate the shortest length of blue and red boomerang. This rule seems strange? so am I.
  • 输入
  • First there is two integer A(no more than 1000) and B(no more than 1000), then followed two lines consist of those A and B numbers.Note that these two array both in ascending order.
  • 输出
  • For each testcase, output the shortest length between red and blue boomerang in a single line.
  • 样例输入
  • 4 4
    1 2 3 4
    5 6 7 8
    5 5
    5 12 14 15 16
    1 2 7 8 9
    
  • 样例输出
  • 1
    2
    
  • 提示
  • 来源
  • Mr.Cai
  • 操作

显示春菜