Language: C++

using namespace std;

int main()
{
	long long N, A, B;
	cin >> N >> A >> B;

	vector<bool> bools;
	bool flag = false;
	while (flag == false)
	{
		for (int i = 0; i < A; ++i)
		{
			if (!flag) {
				bools.push_back(true);
			}

			if (bools.size() >= N) {
				flag = true;
				break;
			}
		}

		for (int i = 0; i < B; ++i)
		{
			if (!flag) {
				bools.push_back(false);
			}

			if (bools.size() >= N) {
				flag = true;
				break;
			}
		}
	}


	cout << count(bools.begin(), bools.end(), true) << endl;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope
    6 |         cin >> N >> A >> B;
      |         ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:8:9: error: 'vector' was not declared in this scope
    8 |         vector<bool> bools;
      |         ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | using namespace std;
a.cc:8:16: error: expected primary-expression before 'bool'
    8 |         vector<bool> bools;
      |                ^~~~
a.cc:15:33: error: 'bools' was not declared in this scope; did you mean 'bool'?
   15 |                                 bools.push_back(true);
      |                                 ^~~~~
      |                                 bool
a.cc:18:29: error: 'bools' was not declared in this scope; did you mean 'bool'?
   18 |                         if (bools.size() >= N) {
      |                             ^~~~~
      |                             bool
a.cc:27:33: error: 'bools' was not declared in this scope; did you mean 'bool'?
   27 |                                 bools.push_back(false);
      |                                 ^~~~~
      |                                 bool
a.cc:30:29: error: 'bools' was not declared in this scope; did you mean 'bool'?
   30 |                         if (bools.size() >= N) {
      |                             ^~~~~
      |                             bool
a.cc:38:9: error: 'cout' was not declared in this scope
   38 |         cout << count(bools.begin(), bools.end(), true) << endl;
      |         ^~~~
a.cc:38:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:38:23: error: 'bools' was not declared in this scope; did you mean 'bool'?
   38 |         cout << count(bools.begin(), bools.end(), true) << endl;
      |                       ^~~~~
      |                       bool
a.cc:38:17: error: 'count' was not declared in this scope
   38 |         cout << count(bools.begin(), bools.end(), true) << endl;
      |                 ^~~~~
a.cc:38:60: error: 'endl' was not declared in this scope
   38 |         cout << count(bools.begin(), bools.end(), true) << endl;
      |                                                            ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;