Logo
(追記) (追記ここまで)

34456번 - Product Codes 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB30282592.593%

문제

A store has hired the Code Cleaning Crew to help it update all of its product codes.

The original product codes are sequences of letters, positive integers, and negative integers. For example, cG23mH-9s is a product code that contains two uppercase letters, three lowercase letters, one positive integer, and one negative integer.

The new product codes are made by removing all lowercase letters, keeping all uppercase letters in order, and adding all the integers to form one new integer which is placed at the end of the code. For example, the new product code for cG23mH-9s is GH14.

Your job is to take a list of original product codes and determine the new product codes.

입력

The first line of input contains a positive integer, $N,ドル representing the number of original product codes that need to be updated. The following $N$ lines each contain one original product code.

Each original product code contains at least one uppercase letter, at least one lowercase letter, and at least one integer. Also, a positive integer never immediately follows another integer. This means, for example, that 23ドル$ is the integer 23ドル$ instead of the integer 2ドル$ followed by the integer 3ドル$.

출력

Output the $N$ new product codes, one per line.

제한

예제 입력 1

1
AbC3c2Cd9

예제 출력 1

ACC14

For the single original product code, the uppercase letters A, C, and C are kept in order and the sum of the integers is 3ドル + 2 + 9 = 14$.

예제 입력 2

3
Ahkiy-6ebvXCV1
393hhhUHkbs5gh6QpS-9-8
PL12N-2G1234Duytrty8-86tyaYySsDdEe

예제 출력 2

AXCV-5
UHQS387
PLNGDYSDE1166

For the first original product code, the uppercase letters A, X, C, and V are kept in order and the sum of the integers is $−6 + 1 = −5$.

For the second and third original product codes, their uppercase letters are also kept in order and the sums of the integers are 393ドル + 5 + 6 − 9 − 8 = 387$ and 12ドル − 2 + 1234 + 8 − 86 = 1166$ respectively.

노트

출처

Olympiad > Canadian Computing Competition & Olympiad > 2025 > CCC 2025 Junior Division 3번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /