Skip to content

Instantly share code, notes, and snippets.

View TechacademyCode's full-sized avatar

Techacademy Code TechacademyCode

View GitHub Profile
n = int(input())
x1 = 1
x2 = 1
while x2 < n:
temp = x1
x1 = x2
x2 = temp + x2
print(x2)
#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;
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n; cin >> n;
int x = 1;
int y = 1;
cout << 1 << "\n" << 1 << "\n";
#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";
#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;
#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)
{
#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()
{
#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()
{
#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++)
{
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)