TouchStone
  Please Login
Login Sign Up
距离CSP第一轮: ??天 距离CSP第二轮: ??天 距离NOIP还有: ??天
 Homepage  Problem Set  Examinations  Submissions  Discussions  Statistics
  • Home
  • Problem Set
  • P4538
  • Problem
  • P4538【2017 山东一轮集训 Day1】Sim
    Limits : Time Limit : - MS   Memory Limit : - KB
    Judgment Tips : 2.5s,512m
    Description

    Input Format

    ac

    Output Format

    ac

    Sample Input

    5 8
    1 2 3 2 1
    1 1 3
    5 1 5
    2 2 4
    1 2 4
    3 3
    4 0 5
    1 1 2
    1 1 5

    Sample Output

    6
    3
    24
    0
    78

    Hint