#include<bits/stdc++.h>
using namespace std;
int main(){
int n, a, b, d;
char s[5];
scanf("%d %d %d", &n, &a, &b);
int ans = 0;
for(int i = 1; i <= n; i++){
scanf("%s %d", &s, &d);
if(s[0] == 'E') ans += d - max(0, d - b) + max(0, a - d);
else if(s[0] == 'W') ans -= d - max(0, d - b) + max(0, a - d);
}
if(ans > 0) printf("East %d\n", ans);
else if(ans < 0) printf("West %d\n", abs(ans));
else printf("0\n");
return 0;
}
./Main.cpp: In function ‘int main()’:
./Main.cpp:9:24: warning: format ‘%s’ expects argument of type ‘char*’, but argument 2 has type ‘char (*)[5]’ [-Wformat=]
scanf("%s %d", &s, &d);
^
./Main.cpp:6:31: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d %d %d", &n, &a, &b);
^
./Main.cpp:9:25: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%s %d", &s, &d);
^