补充2024.3.27的题目,忘提交了
import java.awt.Checkbox;
import java.awt.PageAttributes.OriginType;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.math.MathContext;
import java.security.PublicKey;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Scanner;
import java.util.TreeMap;
import java.util.TreeSet;
import javax.print.attribute.standard.JobMessageFromOperator;
import javax.print.attribute.standard.ReferenceUriSchemesSupported;
import java.awt.Checkbox;
import java.awt.PageAttributes.OriginType;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.math.MathContext;
import java.security.PublicKey;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Scanner;
import java.util.TreeMap;
import java.util.TreeSet;
import javax.print.attribute.standard.JobMessageFromOperator;
public class Main {
public static void main(String[] args) throws IOException {
Scanner sc=new Scanner(System.in);
BufferedReader br1=new BufferedReader(new InputStreamReader(System.in));
PrintWriter pw1=new PrintWriter(System.out);
String[] aStrings=br1.readLine().split(" ");
aa=Integer.parseInt(aStrings[0]);
while(aa>0) {
aa--;
String[] bStrings=br1.readLine().split(" ");
long a=Long.parseLong(bStrings[0]);//Integer.parseInt(bStrings[0]);
long b=Long.parseLong(bStrings[1]);//Integer.parseInt(bStrings[1]);
long c=Long.parseLong(bStrings[2]);//Integer.parseInt(bStrings[2]);
long answer=1;
long biaozhi=0;
long left,right;
left=right=c;
while(true) {
if(biaozhi==1) {
break;
}
left=(left-1)*b+2;
right=right*b+1;
if(left>a) {
break;
}
if(right>=a) {
right=a;
biaozhi=1;
}
answer=answer+right-left+1;
}
pw1.println(answer);
}
pw1.flush();
pw1.close();
}
public static int aa;
}