# Daily Coding Challenge #61

Wing-Kam ・2 min read

This is a series of Daily Coding Challenge. Each day I show a few solutions written in C++. The questions are from coding practice/contest sites such as HackerRank, LeetCode, Codeforces, Atcoder and etc.

/*
AISing Programming Contest 2019 - A - Bulletin Board
*/

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

#define FAST_INP  ios_base::sync_with_stdio(false);cin.tie(NULL)
int main()
{
FAST_INP;
int h,w,n;
cin >> n >> h >> w;
cout << (n-h+1)*(n-w+1);
return 0;
}


/*
AISing Programming Contest 2019 - B - Contests
*/

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

#define FAST_INP  ios_base::sync_with_stdio(false);cin.tie(NULL)
int main()
{
FAST_INP;
int n,a,b,p,s1=0,s2=0,s3=0;
cin >> n >> a >> b;
for(int i=0;i<n;i++) {
cin >> p;
if(p<=a) s1++;
else if(a+1<=p&&p<=b) s2++;
else if(p>=b+1) s3++;
}

cout << min({s1,s2,s3});
return 0;
}

// 1st: <= A
// 2nd: A+1 <= s <= B
// 3rd: s >= B+1


/*
Codeforces Round #655 (Div. 2) - A. Omkar and Completion
https://codeforces.com/contest/1372/problem/A
*/

#include <bits/stdc++.h>
using namespace std;
#define FAST_INP  ios_base::sync_with_stdio(false);cin.tie(NULL)

int main()
{
FAST_INP;
int t,n;
cin >> t;
while(t--){
cin >> n;
for(int i=0;i<n;i++){
// ax+ay!=a
// X,Y,Z can be equal
// hence, print 1 for n times
cout << 1 << " ";
}
cout << "\n";
}
return 0;
}



The source code is available in corresponding repo below. Star and watch for timely updates!

## wingkwong / atcoder

Posted on by:

### Wing-Kam

Consultant by day. Developer by night. AWS certified. Exploring #CloudNative currently.