A

#include<bits/stdc++.h>

using namespace std;

int x,y;

int main(){
	cin >> x >> y;
	if (x == 1) x = 14;
	if (y == 1) y = 14;
	if (x == y) cout << "equal";
	else if (x > y) cout << "ke";
	else cout << "da";
	return 0;
}

B

# include <bits/stdc++.h>
using namespace std;
int n;
string s;
int main() {
	cin >> n >> s;
	for (int i=0; i<n-1; ++i) {
		int la=0,lb=0,ra=0,rb=0;
		for (int j=0; j<=i; ++j) {
			if (s[j] == 'C') la++;
			else lb++;
		}
		for (int j=i+1; j<n; ++j) {
			if (s[j] == 'C') ra++;
			else rb++;
		}
		if (la != ra && lb != rb) {
			cout << i+1;
			return 0;
		}
	}
	cout << "-1";
} 

C

# include <bits/stdc++.h>
using namespace std;

int T,n,v,l,r;

int main() {
	cin >> T;
	while (T--) {
		cin >> n >> v >> l >> r;
		cout << n/v - (r/v - (l-1)/v)<<"\n";
	} 
 }

D

#include<bits/stdc++.h>

using namespace std;

int n,m,a[100010],b[100010],ans;

int main(){
	cin >> n >> m;
	for (int i=1; i<=n; ++i) cin >> a[i], a[i] += a[i-1];
	for (int i=1; i<=m; ++i) cin >> b[i], b[i] += b[i-1];
	for (int i=1,j=1; i<=n; ++i) {
		while (j < m && b[j] < a[i]) j++;
		if (b[j] == a[i]) ans++;
	}
	cout << ans;
	return 0;
}

E

#include<bits/stdc++.h>

using namespace std;

int m,d[500010],x,y;
string a,b;

int main(){
	cin >> a >> b >> m;
	int n = a.length();
	for (int i=1; i<=m; ++i) {
		cin >> x >> y;
		d[x]++;
		d[y+1]--;
	}
	for (int i=0; i<=n; ++i) {
		if (i) d[i] += d[i-1];
		if (d[i]&1) swap(a[i],b[i]);
	}
	cout << a << "\n" << b;
	return 0;
}