#include <stdio.h>
#include <vector>
#include <utility>
#include "../UberLame_src/Integer.h"

int main(int UNUSED(n_arg_num), const char **UNUSED(p_arg_list))
{
	std::vector<int> list;
	const int p_numbers[] = {0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 5, 5, 5};
	list.insert(list.begin(), p_numbers, p_numbers + sizeof(p_numbers) / sizeof(int));

	printf("{");
	for(size_t i = 0, n = list.size(); i < n; ++ i)
		printf((i)? ", %d" : "%d", list[i]);
	printf("}\n");

	printf("%*s^ // %s\n", (std::lower_bound(list.begin(), list.end(), -1) - list.begin()) * 3 + 1, "", "lower_bound(-1)");
	printf("%*s^ // %s\n", (std::lower_bound(list.begin(), list.end(), 0) - list.begin()) * 3 + 1, "", "lower_bound(0)");
	printf("%*s^ // %s\n", (std::lower_bound(list.begin(), list.end(), 1) - list.begin()) * 3 + 1, "", "lower_bound(1)");
	printf("%*s^ // %s\n", (std::lower_bound(list.begin(), list.end(), 2) - list.begin()) * 3 + 1, "", "lower_bound(2)");
	printf("%*s^ // %s\n", (std::lower_bound(list.begin(), list.end(), 3) - list.begin()) * 3 + 1, "", "lower_bound(3)");
	printf("%*s^ // %s\n", (std::lower_bound(list.begin(), list.end(), 4) - list.begin()) * 3 + 1, "", "lower_bound(4)");
	printf("%*s^ // %s\n", (std::lower_bound(list.begin(), list.end(), 5) - list.begin()) * 3 + 1, "", "lower_bound(5)");
	printf("%*s^ // %s\n", (std::lower_bound(list.begin(), list.end(), 6) - list.begin()) * 3 + 1, "", "lower_bound(6)");

	printf("{");
	for(size_t i = 0, n = list.size(); i < n; ++ i)
		printf((i)? ", %d" : "%d", list[i]);
	printf("}\n");

	printf("%*s^ // %s\n", (std::upper_bound(list.begin(), list.end(), -1) - list.begin()) * 3 + 1, "", "upper_bound(-1)");
	printf("%*s^ // %s\n", (std::upper_bound(list.begin(), list.end(), 0) - list.begin()) * 3 + 1, "", "upper_bound(0)");
	printf("%*s^ // %s\n", (std::upper_bound(list.begin(), list.end(), 1) - list.begin()) * 3 + 1, "", "upper_bound(1)");
	printf("%*s^ // %s\n", (std::upper_bound(list.begin(), list.end(), 2) - list.begin()) * 3 + 1, "", "upper_bound(2)");
	printf("%*s^ // %s\n", (std::upper_bound(list.begin(), list.end(), 3) - list.begin()) * 3 + 1, "", "upper_bound(3)");
	printf("%*s^ // %s\n", (std::upper_bound(list.begin(), list.end(), 4) - list.begin()) * 3 + 1, "", "upper_bound(4)");
	printf("%*s^ // %s\n", (std::upper_bound(list.begin(), list.end(), 5) - list.begin()) * 3 + 1, "", "upper_bound(5)");
	printf("%*s^ // %s\n", (std::upper_bound(list.begin(), list.end(), 6) - list.begin()) * 3 + 1, "", "upper_bound(6)");

	/*
{0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 5, 5, 5}
 ^ // lower_bound(-1)
 ^ // lower_bound(0)
		  ^ // lower_bound(1)
				   ^ // lower_bound(2)
							^ // lower_bound(3)
									 ^ // lower_bound(4)
									 ^ // lower_bound(5)
											  ^ // lower_bound(6)
{0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 5, 5, 5}
 ^ // upper_bound(-1)
		  ^ // upper_bound(0)
				   ^ // upper_bound(1)
							^ // upper_bound(2)
									 ^ // upper_bound(3)
									 ^ // upper_bound(4)
											  ^ // upper_bound(5)
											  ^ // upper_bound(6)
Press any key to continue
	*/
	// output of the program above

	return 0;
}
