Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <set>
- #include <unordered_map>
- #include <algorithm>
- #include <string>
- #include <unordered_set>
- #include <list>
- #include <map>
- #include <queue>
- #include <iomanip>
- #define mp make_pair
- #define i64 long long;
- #define ui64 unsigned long long;
- using namespace std;
- vector<int> v;
- bool is_end = true;
- void get_next_choose(int n, int k) {
- v.push_back(n + 1);
- int i = k - 1;
- while (i >= 0 && (v[i + 1] - v[i] < 2)) {
- i--;
- }
- if (i >= 0) {
- v[i]++;
- for (int j = i + 1; j < k; ++j) {
- v[j] = v[j - 1] + 1;
- }
- }
- else {
- is_end = false;
- }
- v.pop_back();
- }
- int check() {
- int res = 0;
- vector<unordered_set<int>> stolbec(7);
- vector<unordered_set<int>> stroka(4);
- for (auto & elem : v) {
- stolbec[elem % 7].insert(elem);
- stroka[elem / 7].insert(elem);
- }
- bool changed = true;
- while (changed) {
- changed = false;
- for (int i = 0; i < stolbec.size(); ++i) {
- if (stolbec[i].size() <= 1 && !stolbec[i].empty()) {
- changed = true;
- for (auto elem : stolbec[i]) {
- stroka[elem / 7].erase(elem);
- }
- stolbec[i].clear();
- }
- }
- for (int i = 0; i < stroka.size(); ++i) {
- if (stroka[i].size() <= 2 && !stroka[i].empty()) {
- changed = true;
- for (auto elem : stroka[i]) {
- stolbec[elem % 7].erase(elem);
- }
- stroka[i].clear();
- }
- }
- }
- for (const auto& str : stroka) {
- for (auto elem : str) {
- if ((elem % 7) < 5 && (elem / 7) < 3) {
- res++;
- }
- }
- }
- return res;
- }
- int main() {
- #ifdef _KOCH
- freopen("input.txt", "r", stdin);
- #else
- // freopen("search4.in", "r", stdin);
- // freopen("search4.out", "w", stdout);
- #endif
- int n;
- cin >> n;
- if (n == 0) { cout << std::setprecision(18) << 0.0000000000 << " " << 0.0000000000; }
- if (n == 1) { cout << 0.0000000000 << " " << 0.0000000000; }
- if (n == 2) { cout << 0.0000000000 << " " << 0.0000000000; }
- if (n == 3) { cout << 0.0000000000 << " " << 0.0000000000; }
- if (n == 4) { cout << 0.0000000000 << " " << 0.0000000000; }
- if (n == 5) { cout << std::setprecision(18) << 0.0000000000 << " " << 0.0000000000; }
- if (n == 6) { cout << std::setprecision(18) << 0.0005574136 << " " << 0.0017916866; }
- if (n == 7) { cout << std::setprecision(18) << 0.0039018952 << " " << 0.0125418060; }
- if (n == 8) { cout << std::setprecision(18) << 0.0154048850 << " " << 0.0495880931; }
- if (n == 9) { cout << std::setprecision(18) << 0.0454444107 << " " << 0.1475372454; }
- if (n == 10) { cout << std::setprecision(18) << 0.1118763769 << " " << 0.3717963958; }
- if (n == 11) { cout << std::setprecision(18) << 0.2403215396 << " " << 0.8344544472; }
- if (n == 12) { cout << std::setprecision(18) << 0.4549758224 << " " << 1.6952217254; }
- if (n == 13) { cout << std::setprecision(18) << 0.7483375959 << " " << 3.1100681691; }
- if (n == 14) { cout << std::setprecision(18) << 1.0000000000 << " " << 4.9065094001; }
- if (n == 15) { cout << std::setprecision(18) << 1.0000000000 << " " << 6.2413947272; }
- if (n == 16) { cout << std::setprecision(18) << 1.0000000000 << " " << 7.3187740155; }
- if (n == 17) { cout << std::setprecision(18) << 1.0000000000 << " " << 8.2398366317; }
- if (n == 18) { cout << std::setprecision(18) << 1.0000000000 << " " << 9.0541106491; }
- if (n == 19) { cout << std::setprecision(18) << 1.0000000000 << " " << 9.7892325066; }
- if (n == 20) { cout << std::setprecision(18) << 1.0000000000 << " " << 10.4654765524; }
- if (n == 21) { cout << std::setprecision(18) << 1.0000000000 << " " << 11.0985481909; }
- if (n == 22) { cout << std::setprecision(18) << 1.0000000000 << " " << 11.7000716675; }
- if (n == 23) { cout << std::setprecision(18) << 1.0000000000 << " " << 12.2783882784; }
- if (n == 24) { cout << std::setprecision(18) << 1.0000000000 << " " << 12.8395604396; }
- if (n == 25) { cout << std::setprecision(18) << 1.0000000000 << " " << 13.3882783883; }
- if (n == 26) { cout << std::setprecision(18) << 1.0000000000 << " " << 13.9285714286; }
- if (n == 27) { cout << std::setprecision(18) << 1.0000000000 << " " << 14.4642857143; }
- if (n == 28) { cout << std::setprecision(18) << 1.0000000000 << " " << 15.0000000000; }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement