• [1249] Busy Garfield

  • 时间限制: 1000 ms 内存限制: 65535 K
  • 问题描述
  • Garfield had been pretty lazy, now he make some plans as follow:
    Garfield at most do M(1 <= M <= 200) things in one day.
    There are N (1 <= N <= 500) things to finsh
    For each thing, It need Nt days to finsh it, The Nt days can pick up during the day St to day Et. the St, Et, Nt(1<=St < Et <= 500, Nt <= Et - St)
    Can he finish these?
  • 输入
  • First line contain a integer T (T <= 20), means the test case;
    For each test case, There are two integers N, M in first line;
    The flowing N lines contain three integers St, Et, Nt;
  • 输出
  • For each test case, if Garfield can finish all the things, print "Yaha, Garfield, You Finish it!", or print "Oh~~Garfield, You are just as before!";
  • 样例输入
  • 2
    3 3
    1 4 2
    1 3 3
    4 5 1
    3 1
    1 4 2
    1 3 3
    4 5 1
    
  • 样例输出
  • Yaha, Garfield, You Finish it!
    Oh~~Garfield, You are just as before!
    
  • 提示
  • 来源
  • monkeyde17
  • 操作

显示春菜