import java.util.Scanner;
public class Main{
public static int n,k,T;
public static void main(String[] args){
Scanner in=new Scanner(System.in);
n=in.nextInt();
k=in.nextInt();
T=in.nextInt();
long resurt=0;
long start=1;
long count=1;
while(T>0){
T--;
resurt+=start;
long tempN=start+(n-1)*(count+count+n-2)/2;
count=count+n-1;
tempN=tempN%k;
start=start%k;
count++;
}
System.out.println(resurt);
}
}
试题 历届试题 数字游戏
最新推荐文章于 2022-02-11 15:35:03 发布