#include <bits/stdc++.h>   using namespace std;   struct scroll {     int pow;     int dmg;     int loc;     bool operator<(const scroll& a) const {       if (dmg > a.dmg)         return true;       else if (dmg == a.dmg && pow < a.pow)         return true;       else         return false;     }   };   struct used_scrollr {     int num;     int time;     bool operator<(const used_scrollr& a) const { return time < a.time; }   };   int main() {     int N, max, reg;     scanf( %d%d%d , &N, &max, &reg);     scroll ary[N];     bool used_scroll[N];     int used_time[N];     for (int i = 0; i < N; ++i) {       int x, y;       scanf( %d%d , &x, &y);       ary[i] = (scroll){x, y, i + 1};       used_scroll[i] = false;     }     sort(ary, ary + N);     int time = 0;     int used_scrolls = 0;     int current_hp = max;     int drain = 0;     while (true) {       current_hp -= drain;       if (current_hp + reg < max)         current_hp += reg;       else         current_hp = max;       if (current_hp <= 0) {         time++;         break;       }       bool used_a_scroll = false;       for (int i = 0; i < N; ++i) {         if (used_scroll[i] == false &&             (((current_hp * 100) / max) +                  ((current_hp * 100) % max == 0 ? 0 : 1) <=              ary[i].pow)) {           used_time[i] = time;           drain += ary[i].dmg;           used_scroll[i] = true;           used_scrolls++;           used_a_scroll = true;           break;         }       }       if ((reg - drain) >= 0 && used_a_scroll == false) break;       time++;     }     if (current_hp <= 0) {       printf( YES n );       printf( %d %d n , time - 1, used_scrolls);       used_scrollr ary2[used_scrolls];       int cnt = 0;       for (int i = 0; i < N; ++i)         if (used_scroll[i])           ary2[cnt++] = (used_scrollr){ary[i].loc, used_time[i]};       sort(ary2, ary2 + used_scrolls);       for (int i = 0; i < used_scrolls; ++i)         printf( %d %d n , ary2[i].time, ary2[i].num);     } else {       printf( NO n );     }   }   