This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n = int(input()) | |
x1 = 1 | |
x2 = 1 | |
while x2 < n: | |
temp = x1 | |
x1 = x2 | |
x2 = temp + x2 | |
print(x2) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
int main() | |
{ | |
// 1 1 2 3 5 8 13 | |
int n; cin >> n; | |
int x = 1; | |
int y = 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
int main() | |
{ | |
int n; cin >> n; | |
int x = 1; | |
int y = 1; | |
cout << 1 << "\n" << 1 << "\n"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
int main() | |
{ | |
int a, b, c; | |
cin >> a >> b >> c; | |
if (a > 0 && b > 0 && c > 0 && a + b > c && c + a > b && b + c > a) | |
{ | |
cout << "YES"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
int main() | |
{ | |
int year; | |
cin >> year; | |
if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) | |
{ | |
cout << "YES" << endl; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
int main() | |
{ | |
int a, b; | |
cin >> a >> b; | |
float x = float(a) / b; // 20 4 | |
if(a % b == 0) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
const int N = 1e6 + 5; | |
long long a[N] = {0}; | |
long long prefix[N] = {0}; | |
// 1 3 1 2 3 5 | |
unordered_map<long long, long long> mp; | |
int main() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
const int N = 1e6 + 5; | |
long long a[N] = {0}; | |
long long prefix[N] = {0}; | |
// 1 3 1 2 3 5 | |
unordered_map<long long, long long> mp; | |
int main() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
const int N = 1e6 + 5; | |
long long uoc[N] = {0}; | |
long long cnt[N] = {0}; | |
void sangUoc() | |
{ | |
for (long long i = 1; i < N; i++) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
x, y, z, n = map(int, input().split()) | |
lcm = math.lcm(x, y, z) | |
# 2 10^1 10^2 - 1 | |
a = math.ceil(10**(n-1) / lcm) | |
b = math.floor((10**n - 1) / lcm) | |
if a > b: | |
print(-1) | |
else: | |
print(a * lcm) |