-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQ015.cpp
More file actions
38 lines (33 loc) · 887 Bytes
/
Copy pathQ015.cpp
File metadata and controls
38 lines (33 loc) · 887 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// but hooman, bedooon estefade az while you may ask
#include <bits/stdc++.h>
using namespace std;
int main(){
int k, n;
bool is_finish = false;
cin >> k;
if (k==1){
cout << 1;
}
else {
for (n=2; is_finish==false; n++){
int sum=0;
for (int i=0; sum<n; i++)
sum += i;
if (sum==n){
int cnt=2;
for (int i=2; i<n; i++)
if (n%i == 0) cnt++;
if (sum == n){
// addad khoob hast
int cnt=2;
for (int i=2; i<n; i++)
if (n%i == 0) cnt++;
if (cnt >= k){
cout << n;
break;
}
}
}
}
}
}