Submission #659147

#TimeUsernameProblemLanguageResultExecution timeMemory
659147zhing_zhouTimovi (COCI18_timovi)Java
20 / 80
976 ms21156 KiB
import java.util.*; public class timovi { public static void main(String args[]) { Scanner sc = new Scanner(System.in); long n = sc.nextInt(), k = sc.nextInt(), m = sc.nextInt(); long var1 = m / (2 * n * k); long a[] = new long[(int)(n)]; for(long i = 0; i < n; i++) { a[(int)(i)] = (2 * k) * var1; } m -= (2 * n * k) * var1; long dir = 1, pos = 0; while(m != 0) { a[(int)(pos)] += Math.min(k, m); m -= Math.min(m, k); pos += dir; if(pos == n) { dir = -1; pos += dir; pos += dir; } } for(long i = 0; i < n; i++) { System.out.print(a[(int)(i)] + " "); } System.out.println(); return; } }
#Verdict Execution timeMemoryGrader output
Fetching results...