// div2a
#include<bits/stdc++.h>
using namespace std;
const int nax = 1005 ;
int n, c;
int p[ nax] , t[ nax] ;
int getScore( ) {
int total = 0 ;
int T = 0 ;
for ( int i = 0 ; i < n; ++ i) {
T + = t[ i] ;
total + = max( 0 , p[ i] - T * c) ;
}
return total;
}
int main( ) {
scanf ( "%d%d" , & n, & c) ;
for ( int i = 0 ; i < n; ++ i)
scanf ( "%d" , & p[ i] ) ;
for ( int i = 0 ; i < n; ++ i)
scanf ( "%d" , & t[ i] ) ;
int score1 = getScore( ) ;
reverse( t, t + n) ;
reverse( p, p + n) ;
int score2 = getScore( ) ;
if ( score1 > score2) puts ( "Limak" ) ;
else if ( score1 < score2) puts ( "Radewoosh" ) ;
else puts ( "Tie" ) ;
return 0 ;
}
// div2B, code1
#include<bits/stdc++.h>
using namespace std;
const int nax = 1e6 + 5 ;
int t[ nax] ;
struct cmp {
bool operator( ) ( int a, int b) {
return t[ a] < t[ b] ;
}
} ;
int main( ) {
int n, k, q;
scanf ( "%d%d%d" , & n, & k, & q) ;
for ( int i = 1 ; i <= n; ++ i) scanf ( "%d" , & t[ i] ) ;
set< int , cmp> displayed;
while ( q-- ) {
int type, a;
scanf ( "%d%d" , & type, & a) ;
if ( type == 1 ) {
displayed.insert ( a) ;
if ( ( int ) displayed.size ( ) > k)
displayed.erase ( displayed.begin ( ) ) ;
}
else {
if ( displayed.find ( a) == displayed.end ( ) )
puts ( "NO" ) ;
else
puts ( "YES" ) ;
}
}
return 0 ;
}
// div2b, version2
#include<bits/stdc++.h>
using namespace std;
const int nax = 1e6 + 5 ;
int t[ nax] ;
int main( ) {
int n, k, q;
scanf ( "%d%d%d" , & n, & k, & q) ;
for ( int i = 1 ; i <= n; ++ i) scanf ( "%d" , & t[ i] ) ;
set< int > displayed;
while ( q-- ) {
int type, a;
scanf ( "%d%d" , & type, & a) ;
if ( type == 1 ) {
displayed.insert ( a) ;
if ( ( int ) displayed.size ( ) > k) {
int worst = * displayed.begin ( ) ;
for ( int x : displayed)
if ( t[ x] < t[ worst] )
worst = x;
displayed.erase ( worst) ;
}
}
else {
if ( displayed.find ( a) == displayed.end ( ) )
puts ( "NO" ) ;
else
puts ( "YES" ) ;
}
}
return 0 ;
}
Ly8gZGl2MmEKI2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKY29uc3QgaW50IG5heCA9IDEwMDU7CmludCBuLCBjOwppbnQgcFtuYXhdLCB0W25heF07CgppbnQgZ2V0U2NvcmUoKSB7CiAgICBpbnQgdG90YWwgPSAwOwogICAgaW50IFQgPSAwOwogICAgZm9yKGludCBpID0gMDsgaSA8IG47ICsraSkgewogICAgICAgIFQgKz0gdFtpXTsKICAgICAgICB0b3RhbCArPSBtYXgoMCwgcFtpXSAtIFQgKiBjKTsKICAgIH0KICAgIHJldHVybiB0b3RhbDsKfQppbnQgbWFpbigpIHsKICAgIHNjYW5mKCIlZCVkIiwgJm4sICZjKTsKICAgIGZvcihpbnQgaSA9IDA7IGkgPCBuOyArK2kpCiAgICAgICAgc2NhbmYoIiVkIiwgJnBbaV0pOwogICAgZm9yKGludCBpID0gMDsgaSA8IG47ICsraSkKICAgICAgICBzY2FuZigiJWQiLCAmdFtpXSk7CiAgICBpbnQgc2NvcmUxID0gZ2V0U2NvcmUoKTsKICAgIHJldmVyc2UodCwgdCArIG4pOwogICAgcmV2ZXJzZShwLCBwICsgbik7CiAgICBpbnQgc2NvcmUyID0gZ2V0U2NvcmUoKTsKICAgIGlmKHNjb3JlMSA+IHNjb3JlMikgcHV0cygiTGltYWsiKTsKICAgIGVsc2UgaWYoc2NvcmUxIDwgc2NvcmUyKSBwdXRzKCJSYWRld29vc2giKTsKICAgIGVsc2UgcHV0cygiVGllIik7CglyZXR1cm4gMDsKfQoKCi8vIGRpdjJCLCBjb2RlMQojaW5jbHVkZTxiaXRzL3N0ZGMrKy5oPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwpjb25zdCBpbnQgbmF4ID0gMWU2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