fork download
  1. #include <bits/stdc++.h>
  2. #include<unordered_set>
  3. #define el "\n"
  4. #define ll long long
  5. using namespace std;
  6. #define yes cout<<"YES\n";
  7. #define no cout<<"NO\n";
  8. #define all(v) v.begin(), v.end()
  9. #define rall(a) a.rbegin() , a.rend()
  10. #define sz(a) a.size()
  11. const ll N = 1e7 + 5, MOD = 1e9 + 7;
  12. void ELMOO() {
  13. ios_base::sync_with_stdio(false);
  14. cin.tie(nullptr);
  15. }
  16. bool isPalindrome(ll x) { // function Palindrome
  17. string s = to_string(x);
  18. string r = s;
  19. reverse(all(r));
  20. return s == r;
  21. }
  22. //-------------------------------------------------------------------------------------------
  23. // o(sqrt(n)) ---> max_n = 10^12 ~ 10^15 --- Function to find the number is prime or not
  24. bool is_Prime(ll n) {
  25. if (n < 2)return 0;
  26. for (ll i = 2; i <= n/i; i++)
  27. {
  28. if (n % i == 0)return 0;
  29. }
  30. return 1;
  31. }
  32. //-------------------------------------------------------------------------------------------
  33. // O(sqrt(n)) ---> max_n = 10^12 ~ 10^15 --- Function to find all divisors of a number
  34. vector<ll> factorize(ll n) {
  35. vector<ll> divisors;
  36. for (ll i = 1; i <= n / i; i++)
  37. {
  38. if(n%i==0) {
  39. divisors.push_back(i);
  40. if(i*i != n) {
  41. divisors.push_back(n/i);
  42. }
  43. }
  44. }
  45. return divisors;
  46. }
  47. //---------------------------------------------------------------------------------------------
  48. // O(sqrt(n)) ---> max_n = 10^12 ~ 10^15 --- Function to find all prime factors of a number
  49. vector<ll>Prime_Factorize(ll n) {
  50. vector<ll> primes;
  51. for (ll i = 2; i <= n / i; i++)
  52. {
  53. while (n % i == 0) {
  54. primes.push_back(i);
  55. n /= i;
  56. }
  57. }
  58. if (n > 1)primes.push_back(n);// لو عدد اكبر من الجذر التربيعي يبقى هو نفسه عدد اولي
  59. return primes;
  60. }
  61. //---------------------------------------------------------------------------------------------
  62. // O(n log log n) --- max_n = 10^7 --- Function to find all prime numbers up to n
  63. vector<bool> is_prime(N, 1);
  64. void sieve() {
  65. is_prime[0] = is_prime[1] = 0;
  66. for (ll i = 2;i <= N / i;i++) {
  67. if (is_prime[i] ) {
  68. for (ll j = i * i;j <= N;j += i) {
  69. is_prime[j] = 0;
  70. }
  71. }
  72. }
  73. }
  74. //---------------------------------------------------------------------------------------------
  75. // O(n log n) --- max_n = 10^5 --- Function to find the number of divisors for each number up to n
  76. vector<ll>nm_of_dv(N);
  77. void sieve_of_divisors() {
  78. for (ll i = 1;i <= N;i++) {
  79. for (ll j = i;j < N;j += i) {
  80. nm_of_dv[j]++;
  81. }
  82. }
  83. }
  84. //---------------------------------------------------------------------------------------------
  85. // O(n log n) --- max_n = 10^7 --- Function to find the smallest prime factor for each number up to n
  86. vector<int>sp(N+1);
  87. void spf() {
  88. for (int i = 0; i <= N; i++)sp[i] = i;
  89. for (int i = 2;i <= N / i;i++) {
  90. if (sp[i] == i) {
  91. for (int j = i * i;j <= N;j += i) {
  92. if (sp[j] == j)sp[j] = i;
  93. //sp[j] = min(sp[j], i);
  94. }
  95. }
  96. }
  97. }
  98. //---------------------------------------------------------------------------------------------
  99. // O(log n) --- max_n = 10^12 ~ 10^15 --- Function to find the GCD of two numbers
  100. ll GCD(ll a, ll b) {
  101. if (b > a)swap(a, b);
  102. if (!b)return a;
  103. return GCD(b, a % b);
  104. }
  105. //---------------------------------------------------------------------------------------------
  106. // O(log n) --- max_n = 10^12 ~ 10^15 --- Function to find the LCM of two numbers
  107. ll LCM(ll a, ll b) {
  108. return (a / GCD(a, b)) * b;
  109. }
  110. //---------------------------------------------------------------------------------------------
  111. // O(log n) --- max_n = 10^12 ~ 10^15 --- Function to find the sum of two numbers under modulo
  112. ll Mod_add(ll a, ll b) {
  113. return ((a % MOD) + (b % MOD)) % MOD;
  114. }
  115. //---------------------------------------------------------------------------------------------
  116. // O(log n) --- max_n = 10^12 ~ 10^15 --- Function to find the difference of two numbers under modulo
  117. ll Mod_sub(ll a, ll b) {
  118. return ((a % MOD) - (b % MOD) + MOD) % MOD;
  119. }
  120. //---------------------------------------------------------------------------------------------
  121. // O(log n) --- max_n = 10^12 ~ 10^15 --- Function to find the product of two numbers under modulo
  122. ll Mod_mul(ll a, ll b) {
  123. return ((a % MOD) * (b % MOD)) % MOD;
  124. }
  125. //---------------------------------------------------------------------------------------------
  126. // O(log n) --- max_n = 10^12 ~ 10^15 --- recursive function to calculate (n^pow) % MOD
  127. ll Fast_power_Mod(ll n, ll pow) {
  128. if (pow == 0)return 1; // base case
  129. ll val = Fast_power_Mod(n, pow / 2);
  130. ll res = val * val % MOD;
  131. if (pow % 2 != 0) {
  132. res *= n;
  133. res %= MOD;
  134. }
  135. return res;
  136. }
  137. //----------------------------------------------------------------------------------------------
  138. // O(log n) --- max_n = 10^12 ~ 10^15 --- Function to convert a number to a different base
  139. vector<int>Convert(ll n, ll base) {
  140. vector<int>digits;
  141. while (n) {
  142. digits.push_back(n % base);
  143. n /= base;
  144. }
  145. reverse(all(digits));
  146. return digits;
  147. }
  148. //----------------------------------------------------------------------------------------------
  149. ll clearBit(ll n, ll idx) {
  150. return (n & (~(1LL << idx)));
  151. }
  152. //----------------------------------------------------------------------------------------------
  153. ll setBit(ll n, ll idx) {
  154. return (n | (1LL << idx));
  155. }
  156. //----------------------------------------------------------------------------------------------
  157. ll toggleBit(ll n, ll idx) {
  158. return (n ^ (1LL << idx));
  159. }
  160. //----------------------------------------------------------------------------------------------
  161. bool is_odd(ll n) {
  162. return (n & 1);
  163. }
  164. //----------------------------------------------------------------------------------------------
  165. bool knowBit(ll n,ll idx) {
  166. return ((n>>idx)&1);
  167. }
  168. //----------------------------------------------------------------------------------------------
  169. int count_ones(ll x)
  170. {
  171. int cnt = 0;
  172. while (x)
  173. {
  174. x &= (x - 1);
  175. cnt++;
  176. }
  177. return cnt;
  178. }
  179. //--------------------------------------------------------------------------
  180. bool isPowerof22(ll n) { // مش هتشتغل هنا هنعمل فانكشن غيرها
  181. return (__builtin_popcountll(n) == 1); // count 1 bits use fun popcount me
  182. }
  183. bool isPowerof2(ll n)
  184. {
  185. return n > 0 && (n & (n - 1)) == 0;
  186. }
  187.  
  188. void solve() {
  189. // sieve_of_divisors();
  190. cout << LCM(36, 40);
  191.  
  192. }
  193. int main() {
  194. ELMOO();
  195. ll t = 1;
  196. // cin >> t;
  197. while (t--) {
  198. solve();
  199. }
  200. return 0;
  201. }
Success #stdin #stdout 0.03s 121432KB
stdin
Standard input is empty
stdout
360