1)  
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,m,a;
	int c,d;
	cin>>n>>m;
	if(n%a==0){
		c=n/a;
	}else{
		c=n/a+1
	}
	if(n%a==0){
		d=m/a;
	}else{
		d=m/a+1
	}
    return 0;
}
2) 
#include<iostream>
#include<string>
using namespace std;
 
int main()
{
	int T;
	cin >> T;
	while(T--)
	{
		string s;
		cin >> s;
		if(s.size() > 3) cout << "NO" << endl;
		else
		{
			int cnt = 0;
			if(s[0] == 'Y' || s[0] == 'y') cnt++;
			if(s[1] == 'E' || s[1] == 'e') cnt++;
			if(s[2] == 'S' || s[2] == 's') cnt++;
			
			if(cnt == 3) cout << "YES" << endl;
			else cout << "NO" << endl;
		}
		
			
	} 
	
	return 0;
 } 

3)
#include<iostream>
#include<string>
using namespace std;
int arr[205][205];
int arr1[205][205];
int arr3[1001];
 
 
int main() {
	
	int a;
	int n, m;
	cin >> a;
	int max = 0;
	for (int k = 1;k <= a;k++) {
		max = 0;
		
		cin >> n >> m;for (int i = 1;i <= n;i++)for (int j = 1;j <= m;j++) { cin >> arr[i][j];arr1[i][j] = arr[i][j]; }
		for (int i = 1;i <= n;i++)for (int j = 1;j <= m;j++) {
			int temp = i;int temp1 = j;
			while (temp <= n && temp1 <= m && temp > 0 && temp1 > 0) { arr1[i][j] += arr[temp - 1][temp1 - 1];temp--;temp1--; }temp = i;temp1 = j;
			while (temp <= n && temp1 <= m && temp > 0 && temp1 > 0) { arr1[i][j] += arr[temp - 1][temp1 + 1];temp--;temp1++; }temp = i;temp1 = j;
			while (temp <= n && temp1 <= m && temp > 0 && temp1 > 0) { arr1[i][j] += arr[temp + 1][temp1 - 1];temp++;temp1--; }temp = i;temp1 = j;
			while (temp <= n && temp1 <= m && temp > 0 && temp > 0) { arr1[i][j] += arr[temp + 1][temp1 + 1];temp++;temp1++; }
 
		}
		for (int i = 1;i <= n;i++)for (int j = 1;j <= m;j++) {
			if (arr1[i][j] > max) {
				max = arr1[i][j];arr3[k] = max;
			}
			
		
		}
		
	}
	
	
	for (int i = 1;i <= a;i++) { cout << arr3[i] << endl; }
 
			return 0;
		
}
  	 	 		 			 					 					 	  			
4)

#include<stdio.h>
#include<string.h>
 
int main()
{
    int k,n,i;
    scanf("%d", &k);
    char s[1001];
    scanf("%s", s);
    n=strlen(s);
    int arr[26];
    for(i=0; i<26; i++)
    {
        arr[i]=0;
    }
    for(i=0; i<n; i++)
    {
        arr[s[i]-97]++;
    }
    int NO=1;
    for(i=0; i<26; i++)
    {
        if(arr[i]%k!=0)
        {
            YES--;
            NO;
        }
 
    }
    if(YES){
    for(int l=0;l<k;l++)
    {
        for(i=0; i<26; i++)
    {
            if(arr[i]>0)
        {
            int r=arr[i]/k;
 
            for(int j=0; j<r; j++)
            {
                printf("%c", i+97);
            }
 
        }
    }
    }
 
    }
    else printf("-1");
}

		 