<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/Main/venv" />
+ <excludeFolder url="file://$MODULE_DIR$/venv" />
</content>
<orderEntry type="jdk" jdkName="Python 3.10 (CCC)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
--- /dev/null
+# WIP
+n, m, k = tuple(map(int, input().split()))
+
+# N number of notes
+# M highest note
+# K number good samples
+
+# best piece
+# 1, 2, 1, 2, 1, 2
+
+# MAX length of good sample = M
+# number of good samples in pattern core = m*(m+1)/2
+output = -1
+for M in range(1, 1+m):
+ # num_good = (m * (m+1) /2) * n//m + (n%m * (n%m+1)/2)
+ num_good = n * (n + 1) / 2 - (n - M) * (n - M + 1) / 2
+ # print(M, num_good, end= ' | ')
+ # for i in range(n):
+ # print((i % M) + 1, end=" ")
+ # print()
+ if num_good == k:
+ output = M
+ # break
+
+if output > 0:
+ for i in range(n):
+ print(m-((i % output) + 1) + 1, end=" ")
+else:
+ print(output)
+
+# n = 5, m = 4
+# 1 2 3 4 1
+
+# 1, 2, 3, 4, 1,(5)
+# 1 2, 2 3, 3 4, 4 1, (4)
+# 1 2 3, 2 3 4, 3 4 1, (3)
+# 1 2 3 4, 2 3 4 1 (2)
+# total = 5+4+3+2 = 14
+
+# input : n=6, m=4
+# 1 2 3 4 1 2
+# 1, 2, 3, 4 ,1, 2 (6)
+# 1 2, 2 3, 3 4, 5 1, 1 2 (5)
+# 1 2 3, 2 3 4, 3 4 1, 4 1 2 (4)
+# 1 2 3 4, 2 3 4 1, 3 4 1 2 (3)
+# good samples = 6(6+1)/2 - (6-4)(6-4+1)/2 = 21-3 = 18
+
+# n = 10, m = 2
+# 1 2 1 2 1 2 1 2 1 2
+# 1 2 1 2 1 2 1 2 1 2 (10)
+# 12 21 12 21 12 21 12 21 12 (9)
+#good samples = 10 + 9= 19
+# 10(11)/2 - (10-2)(10-2+1)/2 = 55 - 36 = 19
+
+# n = 11, m = 2
+# 1 2 1 2 1 2 1 2 1 2 1
+# 1 2 1 2 1 2 1 2 1 2 1 (11)
+# 12 21 12 21 12 21 12 21 12 21 (10)
+# total = 11 + 10 = 21
\ No newline at end of file
+++ /dev/null
-n,M,k = tuple(map(int, input().split()))
-
-# N number of notes
-# M highest note
-# K number good samples
-
-# best piece
-# 1, 2, 1, 2, 1, 2
-
-# MAX length of good sample = M
-# number of good samples in pattern core = m*(m+1)/2
-output = -1
-for m in range(1,1+M):
- # num_good = (m * (m+1) /2) * n//m + (n%m * (n%m+1)/2)
- print(m, num_good)
- if num_good == k:
- output = m
- break
-
-print(output)
-
-# input = 5 5 14
-# 1 2 3 4 1
-# 1, 2, 3, 4, 1,(5)
-# 1 2, 2 3, 3 4, 4 1, (4)
-# 1 2 3, 2 3 4, 3 4 1, (3)
-# 1 2 3 4, 2 3 4 1 (2)