#abc287g. [abc287_g]Balance Update Query

[abc287_g]Balance Update Query

nn 种卡片, 每种卡片有两种属性: 价值AiA_i 和数目 BiB_i, 要求支持 33 种操作

  • 读入(1,x,y)(1, x, y), 将AxA_x 的数值改为 yy
  • 读入(2,x,y)(2, x, y), 将BxB_x 的数值改为 yy
  • 读入(3,x)(3, x), 输出在所有卡片中选择xx张卡片的最大价值, 若i=1nBi<x\sum\limits_{i=1}^{n}B_i <x, 则输出1-1