Here is a formula version:
=ArrayFormula(
array_constrain(
sortn(
filter(
{if(A:A="USA",A:A,),if(A:A="USA",B:B,),A:A="USA",
if(A:A="USA",row(A:A),iferror(vlookup(row(A:A),if(A:A="USA",row(A:A),),1,true),0)+1)},
A:A<>""),
1000,2,4,1),
1000,3)
)
The reason for the long formula is mainly finding a way to get just one row to replace one or more rows that don't start with USA. The basis of the formula is to do a lookup for non-USA rows to get the row number of the most recent USA row. All of the non-USA rows in the same block then have the same row number and can be discarded (apart from the first) using Sortn.
I have added an extra non-USA row at the beginning to check that this edge case works and falls through to the Iferror clause.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…