-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1031.cpp
More file actions
47 lines (39 loc) · 717 Bytes
/
Copy path1031.cpp
File metadata and controls
47 lines (39 loc) · 717 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
39
40
41
42
43
44
45
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <list>
#include <vector>
#define fr(i, a, c) for (int i = a; i < c; i++)
#define sc1(a) scanf("%lld", &a)
#define sc2(a, b) scanf("%lld %lld", &a, &b)
#define LLI long long int
#define ULL unsigned long int;
using namespace std;
int flavious(int n, int k){
int r = 0;
for (int i = 1; i < n; ++i)
{
r = (r + k)%i;
}
return r;
}
int main(int argc, char const *argv[])
{
vector<int> pwrs;
int a,aux,salts,i = 0;
salts = 1;
aux = 0;
while(scanf("%d", &a)){
if (a == 0) break;
salts = 1;
for (;;)
{
int aux = flavious(a, salts);
if (aux != 11){
salts++;
}else break;
}
printf("%d\n", salts);
}
return 0;
}